Multiple choice technology programming languages

A method in a class declared as static may be invoked simply by using the name of the method alone.

  1. True

  2. False

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

Static methods must be invoked using the class name (ClassName.methodName()) or through an object reference (objectRef.methodName()), but never by method name alone. You need either the class context or an object reference to call a static method.

AI explanation

The statement is False. A static method belongs to the class rather than an instance, and outside of its own class it must be invoked using the class name (e.g., ClassName.method()), or via an object reference. It can be called by its bare name only from within code that is already inside the same class, so 'may be invoked simply by using the name of the method alone' is not true in general.