Java OCA OCP Practice Question 1628

Question

Given a class named Main,

which one of these constructor declarations is valid for the class Main?

Select the one correct answer.

  • (a) Main(Main b) {}
  • (b) Main Main() {}
  • (c) private final Main() {}
  • (d) void Main() {}
  • (e) public static void Main(String[] args) {}
  • (f) abstract Main() {}


(a)

Note

A constructor cannot specify any return type, not even void.

A constructor cannot be final, static, or abstract.




PreviousNext

Related