Accessing Memory address

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2008
Posts: 5
Reputation: crbsathy is an unknown quantity at this point 
Solved Threads: 0
crbsathy crbsathy is offline Offline
Newbie Poster

Accessing Memory address

 
0
  #1
Aug 19th, 2008
Hi Friends,
I have a doubt in accessing the memory address .

In java there is no pointers like c . then how can we access the address of the memory variable.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 413
Reputation: sciwizeh is on a distinguished road 
Solved Threads: 22
sciwizeh's Avatar
sciwizeh sciwizeh is offline Offline
Posting Pro in Training

Re: Accessing Memory address

 
1
  #2
Aug 19th, 2008
why do you want to?
My site, random PM's from people I haven't hear from before will be DELETED
"If people are good only because they fear punishment, and hope for reward, then we are a sorry lot indeed.",
"If we knew what it was we were doing, it would not be called research, would it? "
-Albert Einstein
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 5
Reputation: crbsathy is an unknown quantity at this point 
Solved Threads: 0
crbsathy crbsathy is offline Offline
Newbie Poster

Re: Accessing Memory address

 
0
  #3
Aug 19th, 2008
Thanks sciwizeh for ur reply.

I need to fetch the memory address of the variable . In one article which i have read that "we cant say that we cant access the memory location".
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 973
Reputation: Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough 
Solved Threads: 107
Alex Edwards's Avatar
Alex Edwards Alex Edwards is offline Offline
Posting Shark

Re: Accessing Memory address

 
0
  #4
Aug 19th, 2008
Originally Posted by crbsathy View Post
Thanks sciwizeh for ur reply.

I need to fetch the memory address of the variable . In one article which i have read that "we cant say that we cant access the memory location".
Use the Object.toString() method to return the memory address.

  1.  
  2. public static void main(String... args){
  3.  
  4. Object o = new Object();
  5. System.out.println(o.toString());
  6.  
  7. }
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 973
Reputation: Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough Alex Edwards is a jewel in the rough 
Solved Threads: 107
Alex Edwards's Avatar
Alex Edwards Alex Edwards is offline Offline
Posting Shark

Re: Accessing Memory address

 
0
  #5
Aug 19th, 2008
Note that it is a String representation of the memory address and not an accessible (or directly modifiable) memory address.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 3294 | Replies: 4
Thread Tools Search this Thread



Tag cloud for Java
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC