LearnFrenzy
Sign in Take a free test

Java Basics, Syntax and Data Types · Java Basics MCQ · Question 4

The signature of the main method Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 4 Back to Exercise

Which declaration can the JVM use as a program's entry point?

  • A public void main(String args)
  • B public static void main(String[] args) Correct
  • C static int main()
  • D public static main(String[] args)
Correct Answer: Option B

It must be public, static, return void and take a String array (String... args also works).

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links