suppose A is a base class and B is the derved class. Both
have a method foo which is defined as a virtual method in
the base class. You have a pointer of classs B and you
typecast it to A. Now when you call pointer->foo, which
method gets called?
The next part of the question is, how does the compiler
know which method to call?
Answer Posted / nm
The answer is that B->foo gets calle, and why ? I found a
good explanation of that here:
http://en.wikipedia.org/wiki/Virtual_table
Is This Answer Correct ? | 3 Yes | 1 No |
Post New Answer View All Answers
What is the full form of oops?
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
When not to use object oriented programming?
Can we create object of abstract class?
What do you mean by overloading?
any one please tell me the purpose of operator overloading
What is polymorphism and types?
What is the purpose of polymorphism?
What are different oops concepts?
Is this job good for future? can do this job post grduate student?
What are two types of polymorphism?
How to improve object oriented design skills?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
What is advantage of inheritance?
how to get the oracle certification? send me the answer