What is true about protected constructor

date:2024-06-05 12:25:28 author:admin browse: time View comments Add Collection

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.