Question: Quite often I see that
programmers use full name of class in a program. For example like this:
java.util.Vector vect = new Vector();
I do not like such long lines, they are not so nice! Is not it easier to use the
"import" in the beginning of program:
import java.util.*;
and then: Vector vect = new Vector(); ?
Answer: By using full class name in a
program a programmer avoids names collision situation - a case when you could
have your own Vector class in your package:
Compiler will not understand which Vector class you reffer in the line below:
Vector vect = new Vector();
The usage of full class name makes the situation clear.
***************************************
Our older tips: March 22, 2001 - Oktober 21, 2002
read here.
All published and not published on site tips you can find
here
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.