Wednesday, April 11, 2012

Understanding Instance and Class Members (The Java™ Tutorials > Learning the Java Language > Classes and Objects)

Understanding Instance and Class Members (The Java™ Tutorials > Learning the Java Language > Classes and Objects): "Not all combinations of instance and class variables and methods are allowed:

Instance methods can access instance variables and instance methods directly.
Instance methods can access class variables and class methods directly.
Class methods can access class variables and class methods directly.
Class methods cannot access instance variables or instance methods directly—they must use an object reference. Also, class methods cannot use the this keyword as there is no instance for this to refer to."

'via Blog this'

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home