• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

importing packet

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic