how c plus plus is different than java ?

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


3 Answers
1-3 of  3
3 Answers
  • Here are some of the main ways in which C++ differs from Java:

    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.

    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 Java.

    Object-Oriented Programming (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.

    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.

    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.

    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.

    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.
     
    0

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

  • 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
    0

c plus plus programming
Practice Mock Test
c plus plus programming