How many void main methods can we defined in our class.
-
only 1
-
2
-
No need of void main
-
infinite
A
Correct answer
Explanation
A Java class can have only one main method with the signature public static void main(String[] args). This is the entry point that the JVM looks for when executing the class. Overloading main with different parameters is technically possible but only the standard signature serves as the entry point.