What are the fundamental concepts of OOP?

What are different OOP concepts that are in C++ but not in Java?

  • e.g.  multiple Inheritance,operator overloading,virtual function/class ..etc

  • Answer:

    I can't cite all but 2 prominent ones are: 1. all functions in Java are virtual, in C++ you have to explicitly declare virtual. Virtual functions are those that can be overridden in subclasses. 2. C++ allows multiple inheritance, Java doesn't.

Quora User at Quora Visit the source

Was this solution helpful to you?

Other answers

There are three main principles of OOP. These include encapsulation, polymorphism and inheritance.   C++ and JAVA differ in approach to each of the above principles. Encapsulation - JAVA follows encapsulation strictly. Everything has to be written within the boundary of the class. However in C++, one can still define the main( ) method outside a class declaration, which is not possible in JAVA. Polymorphism - C++ supports four different types of polymorphism. They are method overloading, constructor overloading, operator overloading and method overriding. However, you cannot overload operators in JAVA. Inheritance - C++ supports multiple inheritances, which JAVA does not. Still, if the need arises, one can make use of interfaces in JAVA for the same purpose. Besides, JAVA has done away with the concept of friend functions.

Saheb Haque

1) C++ allows friend classes to access members of a class 2) Java all class methods are virtual. 3) Java does not allow multiple inheritance 4) Java is fully object oriented. (everything apart from basic datatypes are classes)

Ramprasad Gopalakrishnan

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.