Close sidebar

how c plus plus is different than java ?

Can c plus plus be used in making online pages or softwares if not than why?

  • Abhishek
  • 4541 Views
  • 3 Answers
3 Answers
  • Here are some of the main ways in which C++ differs from Java:br /br /Syntax: C++ and Java have different syntax styles. C++ uses a more complex syntax with features like pointers, manual memory management, and operator overloading. Java has a simpler syntax with automatic memory management (garbage collection) and does not have pointers or operator overloading.br /br /Memory Management: In C++, developers have direct control over memory management. They can allocate and deallocate memory using features like pointers and the "new" and "delete" keywords. In contrast, Java handles memory management automatically through garbage collection. Developers do not explicitly allocate or deallocate memory in a rel='nofollow' href="https://ezinterviews.io/qa/it/core-java/"Java/a.br /br /a rel='nofollow' href="https://ezinterviews.io/qa/it/oops/"Object-Oriented Programming/a (OOP): Both C++ and Java are object-oriented languages, but they have different approaches to OOP. C++ supports multiple inheritance, allowing a class to inherit from multiple parent classes. Java, on the other hand, supports only single inheritance but provides interfaces to achieve similar functionality.br /br /Performance: C++ is known for its performance and efficiency, as it allows low-level programming and direct hardware manipulation. It compiles to machine code, which generally results in faster execution. Java, being a high-level language, is often considered slower than C++, as it runs on a virtual machine (JVM) and requires bytecode interpretation.br /br /Standard Libraries: C++ and Java have different standard libraries. C++ provides the Standard Template Library (STL), which offers various data structures and algorithms. Java comes with the Java Class Library (JCL), which includes a wide range of classes and APIs for common tasks, such as networking, I/O, and GUI development.br /br /Portability: Java is designed to be platform-independent, meaning that Java programs can run on any system with a compatible JVM. C++ code, on the other hand, needs to be recompiled and possibly modified for each target platform. However, with the use of libraries like Boost, C++ can also achieve a certain level of portability.br /br /Development Environment: Java has a strong emphasis on development tools and has an extensive ecosystem, including integrated development environments (IDEs) like Eclipse and IntelliJ IDEA. C++ also has various IDEs available, such as Visual Studio and CLion, but the development tooling is generally considered more mature and feature-rich for Java.br / 


  • strongC++/strong uses the only compiler whereas, in strongJava/strong, compiler and interpreter both are used. strongC++/strong supports operator overloading and multiple inheritances but strongJava/strong does not. strongC++/strong is more related strongto/strong hardware in contrast strongto Java/strong. strongC++/strong does not provide built-in support for internet whereas strongJava/strong has built-in support for the same.


  • Basically, c++ is not a fully object-oriented language. and also it is not platform independent language. whereas Java is fully object-based and platform independent.In c++ it uses pointers whereas in java it does not.In java it uses the classes whereas in c++ it does not


Practice Mock Test
c plus plus programming