Customer Service Chat
Get quote & make Payment
Rules of inheritance, C/C++ Programming
Rules of Inheritance:
Private members are not inherited; the members can be accessed only within its class. It cannot be used through the object.
Protected members are inherited; but it can be used only within the base and inherited derived class. It cannot be accessed through the object.
Public members are inherited, and public members only can be accessed inside the class as well as outside the class through objects.
The private member and protected member can be accessed outside the class indirectly, that is passing these members in the public members.
Class inherited as private will make all the members of the base class as private in the derived class; and it has to follow the rules of private member to access.
Class inherited as protected will make all the members of the base class as protected in the derived class; and it has to follow the rules of protected member to access.
Class inherited as public will not make any changes to the members of base class in the derived class.
The derived class cannot modify the original characteristic of its base class.
The multiple copies of same class may happen during multiple inheritances. This can be avoided by created virtual base class using "public virtual" key word this make only one copy to be inherited from base classes.
Constructor is not inherited but arguments can be passed from the derived class to the base class constructor using colon operator.
Objects be able to nested, and it is not inheritance.
When the base class and the derived class has the same member function name, only the derived class member can be accessed through derived class object. In this case the base class member function is overridden. The base class member function can be accessed through derived class object only through scope operator if the derived as public.
Posted Date: 9/20/2012 8:21:05 AM | Location : United States
Ask an Expert
Rules of inheritance, Assignment Help, Ask Question on Rules of inheritance, Get Answer, Expert's Help, Rules of inheritance Discussions
Write discussion on Rules of inheritance
Your posts are moderated
Write your message here..
What is token in programming languages, T o k e n : Tokens are s...
T o k e n : Tokens are small entities in a program. Example: identifiers, keywords, constants, operators, strings, etc. These tokens are used almost in same wa
C program for palindrome, C Program for Palindrome Norm...
C Program for Palindrome Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
Display an array using standard input, Stage One Define the specification o...
Stage One Define the specification of the program Add two nxm size matrices Stage Two Divide the program up into separate modules Input Matrix Ad
Programing, #question. write a program number to alphabet in c++..
#question. write a program number to alphabet in c++..
Multiple inheritance, program
Advanced, how to create a shopping cart
how to create a shopping cart
Explain bit-wise operators, Bit-wise Operators Some applications requir...
Bit-wise Operators Some applications require operations to be done on dissimilar bits of a byte separately. Bit-wise operators offer a facility to do just that. There are vario
Palindrome, A palindrome is a string that reads the same from both the ends...
A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome
Write the statements which are used to connect php, Write the statements wh...
Write the statements which are used to connect PHP with MySQL? Statements which can be used to connect PHP with MySQL is: $conn = mysql_connect('localhost'); echo $co
Accounting Assignment Help
Economics Assignment Help
Finance Assignment Help
Statistics Assignment Help
Physics Assignment Help
Chemistry Assignment Help
Math Assignment Help
Biology Assignment Help
English Assignment Help
Management Assignment Help
Engineering Assignment Help
Programming Assignment Help
Computer Science Assignment Help
Why Us ?
~24x7 hrs Support
~Quality of Work
~Time on Delivery
~Privacy of Work
Human Resource Management
Literature Review Writing Help
Terms & Conditions
Copyright by ExpertsMind IT Educational Pvt. Ltd.