Static methods cannot

Static methods cannot

a)       reference instance data
b)       reference non-static instance data
c)       reference other objects
d)       invoke other static methods
e)       invoke non-static methods

Answer:  b.

Explanation:  A static method is a method that is part of the class itself, not an instantiated object, and therefore the static method is shared among all instantiated objects of the class.  Since the static method is shared, it cannot access non-static instance data because all non-static instance data are specific to instantiated objects.  A static method can access static instance data because, like the method, the instance data is shared among all objects of the class.  A static method can also access parameters passed to it.


Enhancing Classes

Learn More Multiple Choice Question :