Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Package import statement  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends

Could someone throw some light on what happens when you write additional import statements besides those that are being used in a java program ?
Does it slows down stuff or something ?

Thanks
 
Saloon Keeper
Posts: 8473
155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Import statements are just an indication for the compiler where to look for classes necessary during compilation. After all classes have been found and the program has been compiled, the imports are just discarded.

Welcome to CodeRanch!
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In other words, imports have precisely zero effect on the generated bytecode, and therefore have zero effect at runtime.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!