aspose file tools*
The moose likes Beginning Java and the fly likes find object in heap?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "find object in heap??" Watch "find object in heap??" New topic
Author

find object in heap??

jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576



Here, class B has the reference of class a.all object exist in Heap Memory.So if find the object B in heap then is it possible to find reference variable A then class a instance?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36452
    
  15
Yes. Since you haven't given "A" private access (as you ought) you can find the "A" reference from an instance of class b easily.
jacob deiter
Ranch Hand

Joined: Apr 02, 2008
Posts: 576
If can you give some pseudo code ?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36452
    
  15
Can you really not work that out for yourself?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: find object in heap??
 
Similar Threads
Private object modifiable in other class
I am not getting K&B page 445
Refrence variable or object
Doubt with shadowing
How to find Object count in Heap