aspose file tools*
The moose likes Beginning Java and the fly likes static variable with assembly code ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "static variable with assembly code ?" Watch "static variable with assembly code ?" New topic
Author

static variable with assembly code ?

Edward Chen
Ranch Hand

Joined: Dec 23, 2003
Posts: 798
we are always told, static variable will be assigned a specific memory space so that it will not be attached to instance of that class. Then how could I verify this ? To get assembly code for that class is a good way or we have other ways ?

Thanks.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18896
    
  40

Edward Chen wrote:Then how could I verify this ? To get assembly code for that class is a good way or we have other ways ?


How about simply instantiating two objects of the same class that has a static variable? And set / get the static variable from those two instances? You can see that changing using one instances affect the other -- not separate variables.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
wood burning stoves
 
subject: static variable with assembly code ?