Java OCA OCP Practice Question 286

Question

Given the following class:

class A extends java.util.Vector { 
     private A(int x)  { super(x); } 
} 

Which statements are true?

  • A. The compiler creates a default constructor with public access.
  • B. The compiler creates a default constructor with protected access.
  • C. The compiler creates a default constructor with default access.
  • D. The compiler creates a default constructor with private access.
  • E. The compiler does not create a default constructor.


E.

Note

The compiler creates a default constructor only if a class has no explicit constructors.




PreviousNext

Related