|Java ||C Language |
|Java is pure object – oriented programming language.
||C does not support object-oriented programs. It is a procedural programming language. |
|Java does not support data types like structure, union and enum.
||C uses structure, union and enum data types. |
|Java does not define the type modifiers keywords auto, extern, register, signed and unsigned.
||C uses type modifiers keywords auto, extern, register, signed and unsigned. |
|Java does not have a preprocessors like #define, #include and #ifdef.
||C uses preprocessors #define, #include and # ifdef. |
|Java use new operator to allocate memory at run time.
||C uses malloc function to allocate memory at run time. |
|Java ||C++ Language |
|Java is pure object – oriented language.
||CPP is basically a C language with object-oriented extension. |
|Java does not support operator overloading.
||CPP uses operator overloading concept to overload operator. |
|Java does not have template classes.
||CPP uses template classes. |
|Java does not support multiple inheritance.
||CPP support multiple inheritance. |
|Java uses interface to implement multiple classes.
||No concept of interface in CPP. |
|Java does not support global variables. Every variable and method is declared within a class.
||CPP support global variables. We can declare variable outside a class also. |
|There is no concept of pointers in java.
||Pointers can be used. |
|Java has replaced destructor with finalize () method.
||CPP uses destructor to destroy allocated memory. |
|There is no concept of header files in java. Only packages are used.
||In CPP we must include a header file before using a header file function. No concept of package. |
|Java supports multithreading programming.
||Multithreading programming cannot be possible in CPP. |
|Java is Platform Independent.
||CPP is Platform dependent. |
|Java supports network programming.
||No, Network programming. |
|In java we can use applet programming to develop web pages.
||No applet programming, no concept of web only window based programs are build. |
|Java supports automatic garbage collection.
||In CPP we have to destroy object by using destructor method. |