• Post Reply Bookmark Topic Watch Topic
  • New Topic

importing unnecessary classes  RSS feed

 
Lucas Franceschi
Ranch Hand
Posts: 106
Mac Mac OS X Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
importing unnecessary classes, does it makes my program run slowly or use more memory?

i mean, is it any bad to import classes that i don't use?
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It has no impact at runtime, it's just a compile-time convenience.
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import statement are not like c-style 'includes'. They are kind of like a PATH variable for the file. they tell the compiler "if you can't figure out what the 'Person' class is, try looking for it in the 'org.mycompany.people' package" - and since package structures are basically a list of directories...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!