Multiple choice technology web technology

How many void main methods can we defined in our class.

  1. only 1

  2. 2

  3. No need of void main

  4. infinite

Reveal answer Fill a bubble to check yourself
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.