C++ vs JAVA

https://www.educba.com/c-plus-plus-vs-java/

在这里插入图片描述
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 Java.
C++ does not provide built-in support for internet whereas Java has built-in support for the same. However, C++ supports socket programming that can be used to achieve the same.
C++ uses the concept of header files to include different libraries in the program. Java uses import functionality to include different classes and its methods in the program.
C++ provides support for default arguments whereas Java does not.
C++ has the concept of scope resolution operator( :: ) which is used to define a method external to the class, whereas Java uses single dot( . ) which can be used to qualify classes with the namespace they came from.
Java does not use a go-to statement like C++.
Java does not have destructors, therefore, exception handling mechanism and garbage collection are different from C++.
Java supports method overloading whereas C++ supports method overloading as well as operator overloading.
Java has the concept of pass-by-value.
Java does not have the implementation of unsigned integers whereas C++ has.
C++ uses pointers and has the capability of manipulating memory addresses.
Java does not use pointers that make it a type-safe programming language.
Java uses Generics whereas C++ uses templates.
The JVM helps in an efficient code optimization so the performance of execution of the program is better than as that of C++.
C++ uses destructors which are automatically invoked at the time of object destruction.
Java has an in-built Thread class that needs to be inherited for the creation of a new thread. A programmer has to override its run() method.
C++ has no support for Threads like Java, C++ achieve the functionality of thread using external libraries.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值