Govt. Exams
Entrance Exams
Multiple inheritance in C++ uses the syntax 'class Derived : public Base1, public Base2 { };' with appropriate access specifiers.
Abstraction is the process of hiding complex implementation details and exposing only the necessary interface to users.
'this' is a constant pointer that points to the current object instance, allowing members to reference themselves.
An abstract class must contain at least one pure virtual function, making it impossible to instantiate objects of that class directly.
A pure virtual function is declared with '= 0' and has no implementation in the base class. Derived classes must override it to create a concrete class.
In C++, the default access specifier for class members is private, meaning they are not accessible outside the class by default.
Encapsulation is the bundling of data (attributes) and methods (functions) into a single unit called a class, hiding internal details from the outside world.
In C++, an interface-like behavior is achieved using an abstract class containing only pure virtual functions. Derived classes must implement these functions, enforcing a contract.
The 'protected' access specifier allows derived classes to access members of the base class while keeping them hidden from the outside world.
A pure virtual function in C++ is declared with the 'virtual' keyword followed by '= 0'. This makes the function purely virtual, requiring derived classes to implement it.