Differences between Java and C

 

Differences between Java and C:

Differences between Java and C

Java is an object oriented language. In an effort to build simple and safe language, the java team did not include some of the c features in Java.

·         Java does not include the C language statement keywords sizeof, and typedef.

·         Java does not contain the data types struct and union.

·         Java does not define the type modifiers keywords auto, extern, signed, and unsigned.

·         Java does not support an explicit pointer type.

·         Java does not have a pre-processor and therefore we cannot use #define, #include, and #ifdef.

·         Java requires that the functions with no arguments must be declared with empty parenthesis and not with the void keyword done in C.

·         Java adds new operators such as instanceof and >>>

·         Java adds labelled break and continue statements.

·         Java adds many features required for object oriented programming.

Differences between Java and C++

·         Java does not support operator overloading

·         Java does not have template classes as in C++

·         Java does not support multiple inheritances of classes.

·         Java does not support global variables.

·         Java does not use pointers.

·         Java has replaced the destructor functions with a finalize () method.

·         There are no header files in Java.


Comments

Popular posts from this blog

COMPUTER SCIENCE TUTORIALS

JAVA NOTES

JAVA NOTES