answersLogoWhite

0


Best Answer

You implement inheritance by deriving a new class of object from an existing class of object. The existing class is known as the base class of the derived class.

Classes declared final cannot be used as bases classes and classes without a virtual destructor (or a virtual destructor override) cannot be used as polymorphic base classes.

User Avatar

Wiki User

6y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

Yes, you are right, you can use multiple inheritance in c plus plus and not in Java. What is the question?

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you implement inheritance in c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is problem in multiple inheritance?

Java does not support direct multiple Inheritance. Harder to implement, not every language support it: C++ does, Java does not.


Does c plus plus supports hierarchical inheritance?

Yes.


How ploymorphism and inheritance is different from that in Java and c plus plus?

C++ allows multiple inheritance while Java does not. In my opinion, multiple inheritance is not useful because it can get very confusing very quick. For polymorphism, C++ does early binding by default, while Java does late binding by default. Late binding is more useful than early binding.


Programme to implement single and multilevel inheritance taking employee as sample base class in c plus plus?

struct employee { }; struct supervisor : employee { // single inheritance -- a supervisor inherits all the public and protected properties of an employee. }; struct manager : supervisor { // multilevel inheritance -- a manager inherits all the public and protected properties of a supervisor (and therefore an employee). };


Write a c plus plus programme to illustrate single inheritance?

struct A {}; // base class struct B : A {} // derived class (single inheritance).


How can a constructor be invoked at the time of inheritance in C Plus Plus?

It cannot. Inheritance is a compile-time operation. Constructors are invoked at runtime at the point of instantiation.


How do you implement insertion into AVL tree in C plus plus?

See related links for an example.


Demonstrate single inheritance in C plus plus?

struct base1 { // ... }; struct base2 { // ... }; struct derived1 : public base1 // single inheritance { // ... }; struct derived2 : public base1, public base2 // multiple inheritance { // ... };


What is stream operator in c plus plus?

There are two stream operators: << (insert or put) and >> (extract or get). Output streams implement the insertion operator, input streams implement the extraction operator and input/output streams implement both operators.


Write a program in c plus plus to implement macro processor?

Don't write, it is already written, google for 'cpp'.


What are the concepts of object oriented programming in c plus plus?

The concepts of OOP in C++ are the same as for OOP in any other programming language: abstraction, encapsulation, inheritance and polymorphism.


What are the main features of OOP in c plus plus?

The main features of OOP are the same regardless of the language. They are: encapsulation; data hiding; inheritance; and polymorphism.