Review Questions

2.12 Which of these are valid declarations of the main() method in order to start the execution of a Java application?

Select the two correct answers.

  1. static void main(String[] args) { /* ... */ }

  2. public static int main(String[] args) { /* ... */ }

  3. public static void main(String args) { /* ... */ }

  4. final public static void main(String[] arguments) { /* ... */ }

  5. public int main(Strings[] args, int argc) { /* ... */ }

  6. static public void main(String args[]) { /* ... */ }

2.13 Which of the following are reserved keywords?

Select the three correct answers.

  1. public

  2. static

  3. void

  4. main

  5. String

  6. args

Get Programmer's Guide to Java™ Certification, A: A Comprehensive Primer, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.