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!