Question 210 of 481
1Z0-811 Java Basics and Syntax Practice Question
Which TWO statements are true about the main method?
⚠ Common exam trap
Oracle often tests the misconception that the main method must be final or cannot be overloaded, but the JLS only mandates public, static, and void, and overloading is permitted as long as the standard signature is present.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
It must be declared public.
The Java Language Specification (JLS) requires the main method to be declared public so that the JVM can access it from outside the class. Option D is correct because the main method must be static, allowing the JVM to invoke it without creating an instance of the class.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
It must be declared final.
Why it's wrong here
Final is not required.
- ✓
It must be declared public.
Why this is correct
The `main` method must be declared `public` to allow the Java Virtual Machine (JVM) to invoke it from outside the class when starting programme execution. This access modifier ensures the method is universally accessible, enabling the JVM to locate and execute the application's entry point. Without it, the JVM would be unable to access and initiate the programme, leading to runtime errors.
- ✗
It must return an int.
Why it's wrong here
Main must return void.
- ✓
It must be declared static.
Why this is correct
Required to be called without an instance.
- ✗
It cannot be overloaded.
Why it's wrong here
Overloading is allowed.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Last reviewed: Jun 30, 2026
This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.