answersLogoWhite

0

A) #include makes the C/C++ compiler to physically copy the entire header file code into the 'Cor C++' programs, Thus the program size will increase unnecessarily and hence it takes more memory and memory processor time.
Where as import statement makes the JVM to go to Java Library, execute the code there and substitute the result into the Java program "Here no code is copied"...................................




During compilation an .obj file will be light weight in c where as heavy during execution, which is constrant to the .class file




Sandeep Bandari (Chandurthy,9704740271)

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

Why doesn't Java use header files?

A header file in C is used to import the features of parent classes in our class. The same feature is provided by the import statement in Java hence the header files are not used.


What is the difference between link and import in CSS?

The @import rule is that it must appear before any linked stylesheets and gives the effect of bringing one stylesheet inside another often. It used to be used to hide styles from some older browsers that would not render those styles correctly and did not recognize the @import tag.


What is the difference between preprocessor directives and header files?

Preprocessor: All the preprocessor commands written in a high level language are processed by the preprocessor before compiler takes over.Example: "#define MAX_ROWS 10"Preprocessor finds all the places and replaces MAX_ROWS with 10 in the files of the project.Compiler: This software, converts the code written in high-level language into object file. Compiler converts all the files of a given project at once.


How do you import such classes if the classes are needed to be imported first before it can be used in program?

To import a class in a program, you typically include an import statement at the top of your code. The syntax for importing a class is: import package_name.class_name;. For example, if you want to import a class called "Person" from a package called "com.example", you would write: import com.example.Person;. Once the class is imported, you can use it in your program by creating objects of that class or accessing its static members.


When does a function need an include directive?

A function requires an include directive whenever it makes use of a data type or function that cannot be forward declared, or where a forward declaration would be undesirable, and where a complete declaration of that type or function exists in another file. That may sound far more complex than intended, but it's really quite simple. The include directive is a signal to the compiler that the specified file is to be inserted into your file in its entirety, just as if you'd typed all the code it contains by hand. This is clearly a huge time saver when it comes to common data types and functions, but how do you decide if an include directive is actually required or not? Simple: comment out the directive and attempt to compile. If it fails, the directive is required. The errors raised will indicate exactly what types or functions it exposes and where they are used. Most C/C++ programmers split their declarations from their definitions. Declarations of functions and data types (including class declarations) are usually placed in a header file (.h), while the definitions of the functions are safely tucked away in a separate source file (.cpp). Programmers are rarely interested in the implementations -- the header should contain all the information necessary to make use of the functions and data types contained therein. But in order to compile, the source file must include the header file. And if the two files must include other files, then we generally place those directives in the header file thus ensuring that the header contains all the necessary information to allow it to be included in other files.

Related Questions

Difference between export promotion and import substitution?

what is d difference between import substitution and export promotion


Why doesn't Java use header files?

A header file in C is used to import the features of parent classes in our class. The same feature is provided by the import statement in Java hence the header files are not used.


What is the difference between imported and exported?

Import is in Export is out.


Is there a visual difference between an import and an original DVD?

i believe import is fuzzier than the original DVD


Write the difference between export and import?

Export is to send goods out of the country. Import is to bring goods into the country.


What is the difference between mono product economy and import oriented economy?

Describe Nigeria's economy as Mono-product and import oriented economy


What is the difference between import and export?

An import is something our country wants, and pays another country to ship in. An export is something another country wants, and pays our country to ship out.


What is the difference between implicit import statements and explicit import statements?

In some cases, many explicit import statements equal only one implicit import statement. Would you rather type this:import java.util.ArrayList;import java.util.List;import java.util.Collection;import java.util.LinkedList;import java.util.Queue;import java.util.HashMap;import java.util.Map;import java.util.PriorityQueue;than this:import java.util.*;Well, the first group of statements is functionally equivalent to the first one.


Difference between global and international strategy?

A global strategy by a company has a goal to import and output goods and services.


What is the difference between manufacturer exporter and merchant exporter?

Please take help of peoples who are dealing in Import & Export activities.


What is the difference between import object and insert new object on the computer system?

Basically it is the same, but some programmers call it import, and some insert. some software allows you to import new object created with another application and this can be insert new object.


Difference between Export LC and import lc?

An import LC is one made with reference to the buyer but with an export LC, the LC is changed to that with reference to the Issuing bank. This gives a stronger guarantee of payment to the seller.