Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position


Join the forum, it's quick and easy

Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position
Virtual Position Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Differentiate between static and nonstatic members in java 2011

View previous topic View next topic Go down

GMT + 3 Hours Differentiate between static and nonstatic members in java 2011

Post by sharmila farooqi Sun May 29, 2011 6:07 pm

Differentiate between static and nonstatic members.
avatar
sharmila farooqi
Monstars
Monstars

Posts : 35
Join date : 2011-05-29

Back to top Go down

GMT + 3 Hours Re: Differentiate between static and nonstatic members in java 2011

Post by Vuhelper Sun May 29, 2011 6:07 pm

Static variables and methods are associated with the class itself and are not tied to any particular object. Therefore static's can be accessed without instantiating an object. Static methods and variables are generally accessed by class name.

The most important aspect of static's is that they occur as a single copy in the class regardless of the number of objects. Static's are shared by all objects of a class.

Non static methods and instance variables are not accessible inside a static method because no this reference is available inside a static method.
avatar
Vuhelper
Deep Bench
Deep Bench

Posts : 97
Join date : 2011-05-29

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

Permissions in this forum:
You cannot reply to topics in this forum