aspose file tools*
The moose likes Beginning Java and the fly likes object and instance variable says that they can change at runtime. 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 "object and instance variable says that they can change at runtime." Watch "object and instance variable says that they can change at runtime." New topic
Author

object and instance variable says that they can change at runtime.

Tomendra Singh
Ranch Hand

Joined: Jun 28, 2008
Posts: 47
hi all,
i am studying head first java,in 2nd chapter there is line which says"i can change at runtime--object, instance variable"

firstly i am confused that "object and instance variable can change something" or it is " they can be changed at run time"

whichever exists,

then please help me to understand that.if possible then please with an example.

thank you very much.


Strength Is Life,Weakness Is Death- Swamy Vivekanand.
SCJP 5.0(87%)
Jackie Gleason
Greenhorn

Joined: Aug 12, 2008
Posts: 8
I will venture a guess....

I believe it is saying an Object's Instance Variables can be changed at run-time. This means that when an object is created a new copy of the variable is created....

Think of it like this Instance variables are different for each instance of the class(object) while static variable values are shared throughout all instances of the object.

The only type of variables that cannot be "changed" at runtime are final variables.

Does that help?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
Like that.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: object and instance variable says that they can change at runtime.
 
Similar Threads
Which happens first?
Query about the object definition...
final modifier
K&B - Statement, Cannot understand
Back to basics - Polymorphism ......