In this tutorial, you will learn the following things in java.
- Differences between C and Java
- Differences between java and c++
DIFFERENCES BETWEEN C AND JAVA
S.N | C | JAVA |
1. | File Name: (.c) | File Name: (.java) |
2. | Pure structured oriented language (Procedural Language) | Pure object oriented language |
3. | It supports pointer concept | – No pointer support- Java indirectly supports pointer via references. |
4. | It has keywords like goto, typedef and sizeof() | It does not support the keywords like goto, typedef and sizeof() |
5. | The data types structure, union & enum are present | It does not support the user defined data types like structure, union & enum |
6. | It has preprocessor | It does not support preprocessor such as #ifdef, #define, #include |
7. | It follows Top down approach | It follows Bottom up approach |
8. | It supports type modifiers like auto, static, register & extern | It does not support type modifiers |
9. | It supports both call by value and call by reference | It supports only call by value concept |
10. | IDEs: Code Blocks, DevCPP, NetBeans, Eclipse CDT | IDEs: NetBeans, Eclipse, IntelliJ IDEA |
11. | C is a one way language system (it supports only compilation) | Java is a two way language system (It supports both compilation and interpretation) |
DIFFERENCES BETWEEN C++ AND JAVA
S.N | C++ | JAVA |
1. | File Name: (.cpp) | File Name: (.java) |
2. | Partially object oriented language. 1. We can write a C++ code with or without using class 2. Because C++ is C with OOPs concepts | Pure object oriented language 1. In Java, it is not possible to write a code without using class concept |
3. | It supports both function overloading and operator overloading | Java supports only function overloading |
4. | It supports pointer concepts | It does not support pointer concepts |
5. | C++ is derived from C (structures) and Simula67 (oops concepts) | Java is derived from C(syntax) and C++ (oops concept) |
6. | It supports header file and global variable | It does not support header file & global variable |
7. | C++ directly supports multiple inheritance | Java does not directly support multiple inheritance but indirectly it supports multiple inheritance by using interface concept |
8. | It has destructor() function to destroy the memory occupied by the objects | It has finalize() function to remove the memory occupied by the objects |
9. | It has template classes | It does not support template classes |
10. | It supports both call by value & call by reference | Java supports only call by value |
11. | C++ is a one way language system (it supports only compilation) | Java is a two way language system (It supports both compilation and interpretation) |
12. | Semicolon must be needed at the end of class programEx.class Hello{ // code}; | Semicolon is not needed at the end of class programEx.class Hello{ // code} |
13. | In c++, an object is a value type. So new modifier is not needed when creating an object in c++ class programEx.class Test{…};…Test obj; // value type | In java, an object is a reference type. So new modifier must be needed when creating an object in a Java class program.Ex.class Test{…}…Test obj=new Test(); // ref type |
14. | C++ is mainly used for system programming. It is lagging in Windows, Web & Mobile applications | Java is mainly used for Windows, Web & Mobile applications |
15. | IDEs: Code Blocks, DevCPP, NetBeans, Eclipse CDT | IDEs: NetBeans, Eclipse, IntelliJ IDEA |
MORE TUTORIALS