Java Include and Import Statement

What is difference between #include and import statement?

Questions by SADAKAR

Showing Answers 1 - 2 of 2 Answers

hari

  • Oct 29th, 2011
 

#include in C/C++: #include makes a compiler to copy header
file code into a C/C++ program.
Dis Adv:It increase the program size unnecessary wastage
of memory and process time.

import in java : import statement makes JVM to go to the
java library execute the code there at finally substitute
the result into java program.JVM physically will not copy
any code.

import is efficient than #include....

  Was this answer useful?  Yes

shilpa

  • Oct 12th, 2015
 

Why the import keyword is more efficient than include?
Above you mentioned only include copies unnecessary information and import not. But how? Give me the explanation clearly

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions