This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes does import statement increase the size Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "does import statement increase the size" Watch "does import statement increase the size" New topic
Author

does import statement increase the size

Saurabh Dixit
Greenhorn

Joined: Jul 18, 2005
Posts: 6
When we import a class in another class, does this increase the size of the java file in which we are importing the file. what kind of performance difference it causes.
Steve McCann
Ranch Hand

Joined: Oct 20, 2004
Posts: 81
The import statement does nothing more than allow you to refer to a class without having to use the fully qualified name.
e.g.

or
Jacquie Barker
author
Ranch Hand

Joined: Dec 20, 2000
Posts: 201
An import statement enables you to refer to a class by the shortened form of its name("ArrayList") versus having to refer to it via its fully qualified name ("java.util.ArrayList"). That is, the following two classes are equivalent:

Also note that the Java Virtual Machine's class loader is a "just in time" loader, meaning that it only loads the bytecode for a class into its memory when you first need it at run time -- i.e., the first time you instantiate an object of a particular type. Please see comments below.

I hope this helps!

Jacquie


Author of Beginning Java Objects, Beginning C# Objects, and Taming the Technology Tidal Wave
Saurabh Dixit
Greenhorn

Joined: Jul 18, 2005
Posts: 6
Thanks jacquie and steve. My doubts have been cleared.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: does import statement increase the size
 
Similar Threads
new to java... about serialization...
effect of imports on java program
Applet loads very slowly!
Importing packages
Too small font