Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

What would be behaviour if the constructor has a return type?

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.

Join The Discussion