-
Junior Member
sample
What is the difference between #include statement in C/C++ and import statement in java?
-
Contributing Member
Re: sample
* import: expresses that the "importing" schema is going to use
definitions and declarations from some other designated target namespace.
The processor can use its own conventions for finding the schema for the
imported NS (e.g. an HTML editor might have a schema for HTML built in),
but the import statement can provide a schema document location hint
(schemaLocation attribute.)
* include: strictly a packaging facility. Lets you write the definition
of a given target namespace in more than one document. Include names the
other document(s) to be used. Include MUST name a document to be
included, and the included document MUST have the same targetNS (if any)
as the includer.
--------------------
suresh
-
Expert Member
Re: sample
The #import directive is an improved version of #include was added to Objective-C.
#include directive in c or in c++ allows to copy the entire header file code into the programs,there by increasing the program size unnecessarily and the CPU process time increases and it also requires more memory.
The import statement makes the JVM to go to Java Library, execute the code there and substitute the result into the Java program and hence it reduces the process time, memory and there is no copy of code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules