java和c++的区别

java和c++的不同点

BASIS FOR COMPARISON C++ Java
Memory Management Managed by developers using pointers. Supports structures and union Controlled by the system, does not use pointers. Supports Threads and Interfaces
Inheritance Provide single and multiple inheritances both Does not support multiple inheritances. Uses the concept of Interface to achieve
Runtime error detection mechanism Programmer’s responsibility System’s responsibility
Libraries Comparatively available with low-level functionalities Provide a wide range of classes for various high-level services
Program Handling Methods and data can reside outside classes. The concept of a global file, namespace scopes available All methods and data reside in the class itself. Concept od Package is used.
Type Semantics Supports consistent support between primitive and object types Different from primitive and object types
Portability Platform dependent as source code must be recompiled for different platform. It uses the concept of bytecode which is platform-independent and can be used with platform-specific JVM.
Polymorphism Explicit for methods supports mixed hierarchies Automatic uses static and dynamic binding

参考文章:https://www.educba.com/c-plus-plus-vs-java/

作者

彭凯

发布于

2022-01-03

更新于

2022-01-03

许可协议

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

评论

You forgot to set the shortname for Disqus. Please set it in _config.yml.