top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is the difference between JAVA, C and C++?

+1 vote
699 views
What is the difference between JAVA, C and C++?
posted Nov 26, 2016 by Jishnu Ramachandran

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Java and C++ are Object Oriented language where as C is procedure oriented which means whenever we develop a project in C then it is top down approach where as in Java/C++ it is bottom up. Please post a separate query if you want to know the difference between bottom up and top down approach.

Now coming to the difference between Java and C++:
1. Java is a true and complete object oriented language. C++ is an extension of C with object oriented behavior. C++ is not a complete object oriented language as that of Java.
2. Java does not provide template classes.C++ offers Template classes.
3. Java supports multiple inheritance using interface. C++ achieves multiple inheritance by permitting classes to inherit from multiple classes.
4. Java does not provide global variables. Global variables can be declared in C++.
5. Java does not support pointers.C++ supports pointers.
6. In Java, destruction of objects is performed in finalize method. In C++, destruction of objects is performed by destructor function.
7. Java doesn’t provide header files. C++ has header files.
8. Java is intrinsecally "write once run everywhere", while most C++ programs (especially mature software that was not born with cross-platformness in mind) can be work some to port to other platforms.
9. There is no goto statement in Java.
10. Exception and Auto Garbage Collector handling in Java is different because there are no destructor into Java.
11. Java has method overloading, but no operator overloading just like c++.

Credit: http://tech.queryhome.com/29470/what-is-the-difference-between-c-and-java

answer Nov 26, 2016 by Salil Agrawal
Thanks..!
...