a) Compilation error
b) Runtime error
c) Compilation and runs successfully
d) Only String return type is allowed
Answer: a
Explanation: The constructor cannot have a return type. It should create and return new object. Hence it would give compilation error.
Related Posts
What would be the behaviour if one parameterized constructor is explicitly defined?
What is not the use of “this” keyword in Java?
What is true about protected constructor?
Abstract class cannot have a constructor.
What is true about constructor?
What is true about Class.getInstance()?
What is false about constructor?
Join The Discussion