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
支付宝转账赞助
支付宝扫一扫赞助
微信转账赞助
微信扫一扫赞助