Multiple choice technology programming languages

It is legal to access a static method using an instance of the class

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

While Java permits accessing static members through an object reference (obj.staticMethod()), this is misleading and discouraged. Static members belong to the class, not instances. The correct practice is ClassName.staticMethod(). The compiler actually uses the declared type of the reference, not the runtime object.