Differences between C++ and Java?
Overview
In this post, we will learn the differences between C++ and Java programming languages.
C++ vs Java
There are many differences between C++ and Java programming languages. Some of them are as follows:
C++ | Java |
C++ isn’t platform-independent. | Java is platform-independent. Java support WORA(Write Once Run Anywhere) |
C++ language supports pointers. | Java programming language doesn’t support pointers. |
No automatic garbage collection in C++ language. | Java supports automatic garbage collection. |
C++ language supports multiple inheritance. | Java doesn’t support multiple inheritances. |
C++ supports operator overloading. | Java doesn’t support operator overloading. |
C++ doesn’t support web programming, it supports only system application programming. | Java supports both system and web programming. J2EE/Servlets can be used to develop web and enterprise applications that can run on application servers. |
C++ supports the goto statement. | Java doesn’t support the goto statement. |
C++ supports structures and unions. | Java doesn’t support structures and unions. |
C++ supports the use of global variables. | Java language doesn’t support global variables. |
C++ supports header files. | No support for header files in Java programming language. |