What is false about constructor

date:2024-06-05 12:24:08 author:admin browse: 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

支付宝转账赞助

支付宝扫一扫赞助

微信转账赞助

微信扫一扫赞助