What are virtual functions?
Answers were Sorted based on User's Feedback
Answer / qapoo
A function is declared virtual in base class when u are
having same functions in both base and derived classes and
you want to access both the functions with same function
call and its done using base class pointer.
e.g
class base
{
public:
void show(){cout<<"hi"};
};
class derived:pubic base
{
public:
void show(){cout<<"bye";}
};
int main()
{
base *ptr;
base b;
derived d;
ptr=&b;
ptr->show();//base class fn is called
ptr=&d;
ptr->show();//derived class fn is called
return 0;
}
| Is This Answer Correct ? | 7 Yes | 3 No |
Answer / nikhil kapoor
The function which supports run time polymorphysm is called
virtual function...
| Is This Answer Correct ? | 3 Yes | 2 No |
write a C++ program for booking using constructor and destructor.
Example for 4 pillar of oops like, Inheritance,Poly,Abstraction,Encabsulation ?
what is overloading
given a set based questions and 5 questions based on it next data sufficiciency questions 2 and 2/3 english sentence completion with options very easy and 2 synononmys paragraph with 10 questions 10 minutes replace =,-,*,% with -,%,+,* type questions 5 3 questions lik following itssickhere itssickthere itssickhere istsickhere which is nt alike the others very easy
What is encapsulation in oop?
What is constructor overloading in oop?
Why is static class not inherited?
who is the founder of c++?
WAP to find the ambiguities in Multiple Inheritance? How are they resolved.(Virtual Functions)
When is an object created and what is its lifetime?
write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).
What is the difference between static polymorphism and dynamic polymorphism?