GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Tech FAQs  >  Programming  >  Java
Go To First  |  Previous Question  |  Next Question 
 Java  |  Question 549 of 928    Print  
in what ways java differ from c++ basing oops concept

  
Total Answers and Comments: 6 Last Update: July 30, 2006     Asked by: jacinthaserine 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 13, 2006 06:42:59   #1  
Deepak        

RE: in what ways java differ from c++ basing oops conc...

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


 
Is this answer useful? Yes | No
February 16, 2006 05:04:37   #2  
vijay        

RE: in what ways java differ from c++ basing oops conc...
Java supports Inheritance indirectly through interfaces.
 
Is this answer useful? Yes | No
February 17, 2006 03:31:13   #3  
vmshenoy Member Since: October 2005   Contribution: 508    

RE: in what ways java differ from c++ basing oops conc...

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.


 
Is this answer useful? Yes | No
April 10, 2006 04:53:12   #4  
salil.kaul Member Since: April 2006   Contribution: 5    

RE: in what ways java differ from c++ basing oops conc...
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.
 
Is this answer useful? Yes | No
April 13, 2006 04:26:38   #5  
Ridha        

RE: in what ways java differ from c++ basing oops conc...
why do you say java is complete object oriented and c++ is not
 
Is this answer useful? Yes | No
July 30, 2006 13:05:13   #6  
prawintowin Member Since: July 2006   Contribution: 5    

RE: in what ways java differ from c++ basing oops conc...

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.


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape