Home > Software > Java > Core-Java
Interview Questions   Tutorials   Discussions   Programs   

Core-Java - What is the difference between C++ & Java?

asked marvit August 16, 2014 09:02 AM  

What is the difference between C++ & Java?


1 Answers

answered By bhjahnavi   0  
All through c++ and java are considered to be following OOP concepts , there are 9 major differences between c++ and java , they are 
1. C++ is partially object oriented language because c++ does not follow all object oriented programming language concepts I.e., without class also we can run a program in c++ .
But java is purely object oriented programming language.
2. "GOTO" statement can be used in c++,but it can't be used in java.
3. In c++ pointers can be used but java there is no concept of pointers in java because all the tough concepts of c and c++ are removed in java and pointers concepts is consider to be the most tough concept so,it is removed in java.
4. Allocation and deallocation of memory is done by programmer,in java allocation is done by the programmer and deallocation is done by Java Virtual Machine (JVM).
5.declaration is not possible at any step in c++, but in java declaration is possible at any step in the program.
6.c++ is platform dependent ,but java is platform independent.
7.c++ follows all the concepts of oop but java also supports all the concepts of oop but not multiple inheritance but this can be achieved through interfaces and package s concept
8.there are 3 access specifiers in c++ they are public ,private and protected ,in java there are 4 access specifiers, they are public,private ,protected and default.
9.constructors and destructors are present in c++ but in java there is no concept of destructor only constructors are present because the work of destructor is performed by JVM.
   add comment

Your answer

Join with account you already have



Ready to start your tutorial with us? That's great! Send us an email and we will get back to you as soon as possible!