File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

importing packet

 
yashendra chandrakar
Greenhorn
Posts: 22
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if i m using only one class suppose java.util.Vector in my code but put import statement as
import java.util.*;
in place of
import java.util.Vector;
does it make any difference in performance or in any other way
 
Anonymous
Ranch Hand
Posts: 18944
  • 0
  • send pies
  • Quote
  • Report post to moderator
During runtime you'll notice no difference whatsoever (the .class file wouldn't differ either) but during compile time the 'import java.util.*' makes the compiler drag in *all* classes from that package, ready to be scrutinized and inspected when needed, so some performance degradation would be noticable during compilation.
If you just need one or a couple of classes from a package it is considered 'well mannered' to explicitly import them instead of importing the entire package.
kind regards
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic