If a class contains a main() method, that method is executed Select one: a. when the class is run b. when another method within the class calls it c. when an object is created from the class d. none of the above

Respuesta :

Answer:

A. When the class is run

Explanation:

The main( ) method is part of its class and not part of objects. So, when the class is run, the main method serve as a point of entry during program execution.

The main( ) method in the Java language is similar to the main( ) function in C and C++.

Without main( ) method in a class, the program cannot be executed but object of a class can be created as the main( ) method is where the path of execution are mostly defined.