Which method signature lets the JVM start a standalone Java application?
A
private static void main(String[] args)
B
public void main(String[] args)
C
public static void main(String[] args)
Correct answer
D
public static int main(String[] args)
Correct answer
C. public static void main(String[] args)
15 views
⚔️
Challenge a friend on JAVA
Same MCQs, timed, live leaderboard. Send the link on WhatsApp – no sign-up needed.
Create challenge
Explanation
The JVM looks for a public static void main(String[] args) method. It must be public so the JVM can access it, static so no object is needed, and void because it returns nothing.
Reference
Asked in: NTS, PPSC, OCA Java
Doubts & discussionNot sure why the answer is C? Ask here and get an explanation.
Ask a doubt about this MCQ
‹ Previous MCQ Which exceptions must be either caught or declared in a throws clause? Next MCQ › Which feature allows a subclass to provide its own implementation of a method defined in its superclass?