If a class have default constructor defined in private access,

if-a-class-have-default-constructor-defined-in-private-access

If a class have default constructor defined in private access, and one parameter constructor in protected mode, how will it be possible to create instance of object?

A. Define a constructor in public access with different signature

B. Directly create the object in the subclass

C. Directly create the object in main() function

D. Not possible

This question was addressed to me in my homework.

My doubt stems from Protected Access Specifier topic in chapter Access Specifiers of Object Oriented Programming

Right option is A. Define a constructor in public access with different signature

Easiest explanation – If a new constructor is defined in public access. That will be available to the whole program. Only restriction will be of the way to use it.