diff between Virtual mathod and abstract method?

diff between Virtual mathod and abstract method?..

Answer / pawan kumar

Virtual methods have an implementation and provide the derived classes with the option of overriding it. Abstract methods do not provide an implementation and force the derived classes to override the method. So, abstract methods have no actual code in them, and subclasses HAVE TO override the method.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More OOPS Interview Questions

what is the difference between <stdio.h>and "stdio.h"?

5 Answers  

can we create and enter the data & hide files using programmes ?

2 Answers   Wipro,

what are the ways in which a constructors can be called?

0 Answers  

write a program to find 2 power of a 5digit number with out using big int and exponent ?

0 Answers  

When is a memory allocated to a class?

11 Answers  

Write a program to accept a number and to print numbers in pyramid format? for eg:for a no. 5 1 212 32123 4321234 543212345

7 Answers  

c++ provides classes...and classes do what we want but why then strcut are used...if we say data hiding... it is also provided by c++ in structs then why to prefer clasess

1 Answers   HCL, TCS,

difference between abstraction and encapsulation with progarammatic eg. hi,just recently i went for an interview .The interviewer asked what is the difference between abstraction and encapsulation with programmatic eg. I gave the answer as encapsulation mean hiding the relevant data which is not useful for the user, eg a electric fan .hiding the information how the electricity is converted into machanical energy. abtraction showing only the relevant data to the user eg electric fan. it look ,its color ,it design etc only relevant data. Then the interviewer asked me, give me some programmic eg .I Said Let assume a web form having control like textbox,button etc. The user can view textbox,button etc this is the eg of abstraction and when the user click on the button how he is redirected is not known by the user is the eg of the encapsulation. Am I Correct .was the answer given by me is perfect .now i am planing to go for an another interview should i give the same answer.IF not please suggest me a better answer.with some good eg Please help

1 Answers  

monkey starts climbing up a tree 20ft tall,each hour ,it hops 3ft and slips back by 2ft .how much time it wil tak to reach top of the tree?

13 Answers   IonIdea,

What is R T T I ?

6 Answers   Ness Technologies,

What is the output of the following code: int v() { int m=0; return m++; } int main() { cout<<v(); } 1) 1 2) 0 3) Code cannot compile

4 Answers  

Conversion from a basic type to a class type may be achieved using______________

5 Answers   HCL,