Comment: C++ "includes" behavior and java "imports"
Answer Posted / mrangababu
#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 unnecessarly.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....
| Is This Answer Correct ? | 16 Yes | 4 No |
Post New Answer View All Answers
Can we access interface static method using interface references?
What is @functionalinterface?
Differences between functional programming and object-oriented programming?
What is the practical implementation of inner classes?
What is the difference between public, private and protected access modifiers?
Describe the Diamond problem. Where does this problem occur?
Is iterator a class or interface? What is its use?
Can we have default method with same name and signature in the derived interface as the static method in base interface and vice versa?
What are Classes and Objects?
If a method definition has been specified in class , its base class , and the interface which the class is implementing, which definition will be picked if we try to access it using interface reference and class object?
What are the limitations of oops?
What are the different principle of OOPS?
When will you use an interface and abstract class?
Is @functionalinterface annotation mandatory to define a functional interface? What is the use of @functionalinterface annotation? Why do we need functional interfaces in java?
Can you call the base class method without creating an instance?