What is false about constructor

date:2024-06-05 12:24:08 author:admin browse: time View comments Add Collection

What is false about constructor

What is false about constructor?

a) Constructors cannot be synchronized in Java

b) Java does not provide default copy constructor

c) Constructor can have a return type

d) “this” and “super” can be used in a constructor

Answer: c

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