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

1 thought on “ What would be behaviour if the constructor has a return type?”

  1. a
    Explanation: The constructor cannot have a return type. It should create and return new object. Hence it would give compilation error.

Leave a Comment