
1- What are the differences between #include<> statement and import statement?
| C/C++ | Java |
|---|---|
| #include<> statement is available upto C and C++. | import statement is available upto JAVA. |
| #include<> statements are used to include the predefined library which is available in the form of header files | import statements are used to include the predefined library which are packages |
| #include<> statement is providing static loading. | import statement is providing dynamic loading. |
| #include<> statements are recognized by Pre-Processor | import statements are recognized by both Compiler and JVM. |
| By using Single #include<> statement we are able to include only one header file. | By using single import statement we are able to include more than one class or more than one interface of the same package |
| C and C++ are platform dependent programming languages | JAVA is platform Independent programming language |
2- What are the differences between .exe file and .class file?
| C/C++ | Java |
|---|---|
| exe file is available upto C and C++ only. | .class file is available upto Java. |
| .exe file contains directly executable code. | .class file contains bytecode, it is not executable code directly, it is an intermediate code |
| .exe file is platform dependent file | .class file is platform independent file. |
| .exe file is less secured file. | .class file is more secured file. |