OCA Java SE 8 Mock Exam Review - OCA Mock Question 20


Which of the following statements are true?

public class Main {  
   public Main(int i, float f) { }  
   public Main(float f, int i) { } 
   public Main(float f) { } 
   public void Main() { } 
  1. A syntax error will occur because void cannot be used with a constructor.
  2. A syntax error will occur because the first two constructors are not unique.
  3. The class does not have a default constructor.
  4. No syntax errors will be generated.


C and D


The last Main method happens to have the same name as the constructor.

The class has no default constructor.