Q25. Why is the main method public static void main(String[] args)?
public so the JVM can call it from outside the class. static so it runs without creating an instance first, since there's no object yet at startup. void because it returns nothing to the JVM. String[] args to receive command-line arguments.
Each modifier is there for a reason, and interviewers ask this to see whether you understand them or just memorized the incantation. Since Java 21 there's also a preview simplified main for beginners, worth a sentence if it comes up.
public class App {
public static void main(String[] args) {
System.out.println("running: " + args.length + " args");
}
}