KnowledgeBoat Logo
|

Computer Applications

Constructor functions obey the usual access rules. What does this statement mean ?

Java Constructors

4 Likes

Answer

Constructor functions obey the usual access rules. It means that a private or protected constructor is not available to the non-member functions.

With a private or protected constructor, one cannot create an object of the same class in a non-member function. Only the member functions of that class can create an object of the same class and invoke the constructor.

Answered By

4 Likes


Related Questions