What would be the behaviour if one parameterized constructor

date:2024-06-05 12:26:07 author:admin browse: View comments Add Collection

What would be the behaviour if one parameterized constructor

What would be the behaviour if one parameterized constructor is explicitly defined, but no default constructor is provided?

a) Compilation error

b) Compilation succeeds

c) Runtime error

d) Compilation succeeds but at the time of creating object using default constructor, it throws compilation error

Answer: d

Explanation: The class compiles successfully. But the object creation of that class gives a compilation error.

支付宝转账赞助

支付宝扫一扫赞助

微信转账赞助

微信扫一扫赞助