What is true about protected constructor
What is true about protected constructor?
a) Protected constructor can be called directly
b) Protected constructor can only be called using super()
c) Protected constructor can be used outside package
d) protected constructor can be instantiated even if child is in a different package
Answer: b
Explanation: Protected access modifier means that constructor can be accessed by child classes of the parent class and classes in the same package.
支付宝转账赞助
支付宝扫一扫赞助
微信转账赞助
微信扫一扫赞助