0

Can one give a exat answer for this question

i have a java program with hundred packages imported but iam not using any one of them in program .i have only a SOP which prints hello world! .the qustion is will this program is thick with all the imported 100 packages ..Can anyone throw some light over here .. :D

thanks
Shyam

3
Contributors
3
Replies
4
Views
11 Years
Discussion Span
Last Post by skoiloth
1

There's an easy way to find out. Compile the program with none of the imports and take note of the size (get the exact size, such as 3221 bytes rather than 3.2 kilobytes). Compile the program with many imports and take note of the size. Then compare the two sizes and see if there is any difference.

In my experience, declaring imports does nothing more than tell the compiler where search for class files that haven't been referred to by their full name. I can't say that this won't have any affect on the size of the byte file however, so I recommend that you check it out for yourself.

0

What I'm wondering is why anyone would ask such a question during a job interview in the first place...
And if they did, why they'd put it in such terrible English.

0

thanks chris
i compiled the java file with imports and with out imports . there is no size diff
Will import delay the compile time

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.