What are the advantages of inheritance?

Answer Posted / sudhir kumar

The main advantage of the inheritance is that we can acheive
encapsulation because there is early binding in inheritance.
Means our derived class object is already fix to all
appropriate classes functions. And encapsulation is so
because any body do not know that what are the names of base
classes and their information.

And as every one knows Reuseability....

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6245


Why is oop useful?

699


What polymorphism means?

703


What is polymorphism and example?

666


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

1737






Where You Can Use Interface in your Project

1506


What is property in oops?

668


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.

760


write a program to find 2^n+1 ?

1654


#include #include #include #include void select(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); select(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void select(char *items, int count) { register int a, b, c; int exchange; char t; for(a = 0; a < count-1; ++a) { exchange = 0; c = a; t = items[ a ]; for(b = a + 1; b < count; ++b) { if(items[ b ] < t) { c = b; t = items[ b ]; exchange = 1; } } if(exchange) { items[ c ] = items[ a ]; items[ a ] = t; } } } design an algorithm for Selection Sort

2167


What is overriding vs overloading?

670


what type of question are asked in thoughtworks pair programming round ?

1848


What is encapsulation oop?

672


What is class and object in oops?

701


Who invented oop?

736