why overriding?
Answers were Sorted based on User's Feedback
Answer / ejaz
In two classes(having parent child/common interface
relation) methods with same signature and execution of
method decided at run time based on object type.
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / vic
To elaborate on Ejaz's answer, the run time determination
will only happen if the functions being called were declared
as being virtual.
If they weren't, then the function to be called will be
determined at compile time according to the object type.
| Is This Answer Correct ? | 0 Yes | 0 No |
Difference ways of Polymorphism?
difference between class and object
10 Answers Chandan, IBM, Magic Soft,
I hv a same function name,arguments in both base class and dervied class, but the return type is different. Can we call this as a function overloading? Explain?
difference between structure and union.
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
Base class has two public data members. How can i derive a new class with one datamember as public and another data member as private?.
what isthe difference between c structure and c++ class
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
Write a macro for swapping integers
What is variable example?
In the following declaration of main, "int main(int argc, char *argv[])", to what does argv[0] usually correspond? 1) The first argument passed into the program 2) The program name 3) You can't define main like that
Why is encapsulation used?