Comment: C++ "includes" behavior and java "imports"

Showing Answers 1 - 2 of 2 Answers

by using include preprocessor kn c++  the program size will be slightly increased but when we use import statement in java the program size will not be increased at all

  Was this answer useful?  Yes

whenkeys

  • Aug 11th, 2008
 

Both behave the same way except that when we import in java we can import single class also but we have to include a file and not a Class in C++.

eg: import java.lang        //you can even go to specific class here
      inlcude "iostream.h"  //you can only specify the header file and not the class

  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