OCA Java SE 8 Building Blocks - OCA Mock Question Building Block 12








Question

Which of the following are true? (Choose all that apply)

     public class Main { 
          public static void main(String[] args) { 
             Main m = new Main(); 
          } 
     } 
     
  1. Main is a class.
  2. m is a class.
  3. main is a class.
  4. Main is a reference to an object.
  5. m is a reference to an object.
  6. main is a reference to an object.
  7. None of the above.




Answer



A, E.

Note

Main is a class, which can be seen from the declaration: public class Main.

m is a reference to an object.

main() is a method.