Notifications Mark All Read
Super Saver Sale is live now. Grab 30% flat off on all subscription.
Use Coupon Code SAVER
June 23, 2019
Pure virtual function
Pure static function
Pure Const function
A pure virtual function does not have a definition corresponding to base class.
Please login to submit your explanation
You can check your performance of this question after Login/SignupLogin
virtual void show()=0
void virtual show()==0
virtual void show()==0
void virtual show()=0
Syntax for Pure Virtual Function is virtual void show() = 0;
Dynamic binding or late binding is the mechanism a computer program waits until runtime to bind the name of a method called to an actual subroutine. It is an alternative to early binding or static binding where this process is performed at compile-time
We can’t create its objects.
We can’t create pointers to an abstract class.
It contains at least one pure virtual function.
We can create references to an abstract class.
They must be non-static member function of the class
They cannot be friends
Constructor Functions cannot be virtual
All of these
A virtual function is a member function which is declared within a base class and is re-defined(Overriden) by a derived class. When you refer to a derived class object using a pointer or a reference to the base class, you can call a virtual function for that object and execute the derived class’s version of the function.
In programming languages, ad hoc polymorphism is a kind of polymorphism in which polymorphic functions can be applied to arguments of different types, because a polymorphic function can denote a number of distinct and potentially heterogeneous implementations depending on the type of argument(s) to which it is applied.
For cout the over load >> operator
Operators that cannot be overloaded in C++
must be a member function
must be a non member function
can be both (A) & (B) above
cannot be overloaded
The overloaded << operator function must then be declared as a friend of class Date so it can access the private data within a Date object.
When a virtual function is initialized with zero it is called a pure virtual function.
Please login to report
Login/Signup to comment