Thursday, April 18, 2024

Which of the statements are True?

 


Answer: a,b,d

Function overloading is done at compile time.

In C++, protected members of a base class can be accessed by members and friends of any derived classes from that base class. Protected members that are also declared as static are accessible to any friend or member function of a derived class. Protected members that are not declared as static are accessible to friends and member functions in a derived class only through a pointer to, reference to, or object of the derived class.

Derived classes do not inherit constructors or destructors from their base classes. However, they do call the constructor and destructor of base classes.

A friend function in C++ can be called as a normal function. Friend functions are not members of a class, but they have access to the class's private and protected members. They are declared using the keyword friend.

A nested class is a separate class that can see the private members of the enclosing class. The derived class technically inherits a copy of the class definition, but there's nothing special about that relationship. A nested class is useful for encapsulation, information hiding, and grouping related functionality together in a single class. 


0 comments:

Post a Comment

Data Structures with C++



NET/SET/CS PG



Operating Systems



Computer Networks



JAVA



Design and Analysis of Algorithms



Programming in C++

Top