c语言和java之间的对话
In this tutorial I am going to share difference between C++
and Java. C++ programming language was developed by Bjarne Stroustrup in the
year 1983 and Java Language was developed by James Gosling in the year 1995.
Both C++ and Java are object oriented programming language but still there are
lot of differences between them.
and Java. C++ programming language was developed by Bjarne Stroustrup in the
year 1983 and Java Language was developed by James Gosling in the year 1995.
Both C++ and Java are object oriented programming language but still there are
lot of differences between them.
Also Read: Difference between C and C++
Difference between C++ and Java
C++
|
Java
|
C++ is a procedural and object oriented programming language.
|
Java is pure object oriented programming language.
|
C++ support structure, union, template, preprocessor, default
arguments, operator overloading and pointers. |
Java doesn’t support all these features. Java has concept of “restricted
pointers” that uses references which acts like pointers. But we can’t perform arithmetic operations on it. |
C++ support destructor, which is called to destroy the objects.
|
Java doesn’t support destructor because it supports automatic garbage
collection. |
In C++ we can declare global variables and can define methods outside
the class using scope resolution operator (::). |
Java doesn’t have scope resolution operator and we can declare global
variables. The methods can only be defined inside the class. |
C++ support goto statement. Use of goto is not considered good because
it makes difficult to understand the program. |
goto and const keywords are reserved in Java but they are not used.
|
C++ supports multiple inheritance and it can be implemented using
class. |
Java doesn’t support multiple inheritance. Although it can be
implemented using interface. |
C++ is a platform dependent language. Write once, compile anywhere
(WOCA). |
Java is a platform independent language. Write once, run anywhere /
everywhere (WORA / WORE). |
C++ only uses compiler.
|
Java uses both interpreter and compiler.
|
C++ doesn’t have built in thread support. We have to use third party
libraries for thread support. In C++ 11, the thread support is added as a built in feature. |
Java has built in thread support. There is a Thread class which is
used to implement multithreading. |
These are few difference between C++ and Java. If you find
any mistake in above tutorial or know about any other difference between Java and C++ then please comment
below.
In this tutorial I am going to share difference between C++
and Java. C++ programming language was developed by Bjarne Stroustrup in the
year 1983 and Java Language was developed by James Gosling in the year 1995.
Both C++ and Java are object oriented programming language but still there are
lot of differences between them.
and Java. C++ programming language was developed by Bjarne Stroustrup in the
year 1983 and Java Language was developed by James Gosling in the year 1995.
Both C++ and Java are object oriented programming language but still there are
lot of differences between them.
Also Read: Difference between C and C++
Difference between C++ and Java
C++
|
Java
|
C++ is a procedural and object oriented programming language.
|
Java is pure object oriented programming language.
|
C++ support structure, union, template, preprocessor, default
arguments, operator overloading and pointers. |
Java doesn’t support all these features. Java has concept of “restricted
pointers” that uses references which acts like pointers. But we can’t perform arithmetic operations on it. |
C++ support destructor, which is called to destroy the objects.
|
Java doesn’t support destructor because it supports automatic garbage
collection. |
In C++ we can declare global variables and can define methods outside
the class using scope resolution operator (::). |
Java doesn’t have scope resolution operator and we can declare global
variables. The methods can only be defined inside the class. |
C++ support goto statement. Use of goto is not considered good because
it makes difficult to understand the program. |
goto and const keywords are reserved in Java but they are not used.
|
C++ supports multiple inheritance and it can be implemented using
class. |
Java doesn’t support multiple inheritance. Although it can be
implemented using interface. |
C++ is a platform dependent language. Write once, compile anywhere
(WOCA). |
Java is a platform independent language. Write once, run anywhere /
everywhere (WORA / WORE). |
C++ only uses compiler.
|
Java uses both interpreter and compiler.
|
C++ doesn’t have built in thread support. We have to use third party
libraries for thread support. In C++ 11, the thread support is added as a built in feature. |
Java has built in thread support. There is a Thread class which is
used to implement multithreading. |
These are few difference between C++ and Java. If you find
any mistake in above tutorial or know about any other difference between Java and C++ then please comment
below.
翻译自: https://www.thecrazyprogrammer.com/2015/04/difference-between-c-and-java.html
c语言和java之间的对话