In what ways java differ from c++ basing oops concept

Questions by jacinthaserine   answers by jacinthaserine

Showing Answers 1 - 6 of 6 Answers

Deepak

  • Feb 13th, 2006
 

C++ supports mutliple inheritance. Java doesn't support multiple inheritance.

  Was this answer useful?  Yes

vijay

  • Feb 16th, 2006
 

Java supports Inheritance indirectly through interfaces.

  Was this answer useful?  Yes

hi

In c++,we had multple inheritance ,but java does not support it since this concept increases the effort required with very little benefits.

C++ -v could use pointers but in java there is no concept of it,since security is kept in mind.

c++ not 100% object oriented but java is.

C++ only had abstract classes but java has interfaces too.

  Was this answer useful?  Yes

salil.kaul

  • Apr 10th, 2006
 

Java is different from C++ in the following ways:1. Java compiles into bytecode hence it is platform independent (JVM is platform specific which is the runtime hence same code can run on any platform)C++ requires platform specific compiler which are hard to implement.2. Java has reference types and no pointers (pointers can access memory locations using pointer arithmetic) hence they are a security risk.Java programs run in a JVM sandbox.3. Java performs bounds checking on its arrays and strings are represented as char arrays while string is an object in java.4. Java does not have default argument methods while C++ has.5. C++ does not have a language supported feature like packages.6. C++ supports operator overloading.Java does not. ("+" operator is implicitly overloaded)7. C++ supports multiple inheritance (Java has a workaround with interfaces) but no explicit multiple inheritance.

  Was this answer useful?  Yes

Ridha

  • Apr 13th, 2006
 

why do you say java is complete object oriented and c++ is not

  Was this answer useful?  Yes

Hi,

    Java doesnot support multiple inheritance. This is where java differs from c++. Consider a class called Human and a sub class may be Student, Engineer, Employee. All the three has Human characteristics. But in C++, We can inherit the characteristics by extending a Human class and Animal class to Student class. The relationship in inheritance should be either is-A or has-A relationship. is-A relationship can be achieved by using extends  keyword and has-A relationship can be achieved by using implements keyword.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions