The Yaoi Universe
Would you like to react to this message? Create an account in a few clicks or log in to continue.

The Yaoi Universe

this is boy+boy love and everything that goes with it. Must be 16+ to join
 
HomeLatest imagesSearchRegisterLog in

 

  Inheritance

Go down 
AuthorMessage
meodingu

meodingu


Posts : 156
Join date : 2010-09-21

           Inheritance  Empty
PostSubject: Inheritance               Inheritance  Icon_minitimeTue Jan 11, 2011 10:07 pm

Inheritance
Inheritance allows one data type to acquire properties of other data types. Inheritance from a base class may be declared as public, protected, or private. This access specifier determines whether unrelated and derived classes can access the inherited public and protected members of the base class. Only public inheritance corresponds to what is usually meant by "inheritance". The other two forms are much less frequently used. If the access specifier is omitted, a "class" inherits privately, while a "struct" inherits publicly. Base classes may be declared as virtual; this is called virtual inheritance. Virtual inheritance ensures that only one instance of a base class exists in the inheritance graph, avoiding some of the ambiguity problems of multiple inheritance.
Multiple inheritance is a C++ feature not found in most other languages. Multiple inheritance allows a class to be derived from more than one base class; this allows for more elaborate inheritance relationships. For example, a "Flying Cat" class can inherit from both "Cat" and "Flying Mammal". Some other languages, such as Java or C#, accomplish something similar (although more limited) by allowing inheritance of multiple interfaces while restricting the number of base classes to one (interfaces, unlike classes, provide only declarations of member functions, no implementation or member data). An interface as in Java and C# can be defined in C++ as a class containing only pure virtual functions, often known as an abstract base class or "ABC". The member functions of such an abstract base classes are normally explicitly defined in the derived class, not inherited implicitly.


China surveillance supplier
Home improvement
Back to top Go down
 
Inheritance
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
The Yaoi Universe :: General Chill Out :: Disscussion-
Jump to: