aspose file tools
The moose likes Beginning Java and the fly likes address of primitive data type Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "address of primitive data type " Watch "address of primitive data type " New topic
Author

address of primitive data type

sivaprasad chintapalli
Greenhorn

Joined: Aug 31, 2005
Posts: 2
How can I find the address of primitive data type in java.
ie how can I find the adrress of constant 'a' declared below,

final static int a =40;

Quick response would be highly appreciated .
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489


Quick response would be highly appreciated .


Isnt it always ?
What do you intend to do with the info anyways ?
And besides this is not the right forum, I believe, for such questions.

cheers,
ram.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

This is not a Servlet question so I'll move it to the Java in General (beginner) forum. You'll be sure to get a quick reply there.

Dave
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35224
    
    7
I'll bite and supply the quick answer David was talking about

You can't. Java hides the details of in-memory representation, and particularly has no concept of accessing data structures in memory by address. Given that, the previous poster was right to ask: what do you need the info for?


Android appsImageJ pluginsJava web charts
Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

How can I find the address of primitive data type in java.
Short answer: You can't. If it's local, it's on the stack. If it's a member of an object, it's on the heap. Either way, there's no way in Java to get at that information; Java doesn't allow it by design.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: address of primitive data type
 
Similar Threads
Console User Input?
Casting in array
address of primitive data type
Can we Pass Primitive data type in HashMap?
serizalize primitive data type