This week's book giveaway is in the Features new in Java 9 forum.
We're giving away four copies of Java 9 Revealed and have Kishori Sharan on-line!
See this thread for details.
Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Is there any difference in package importing?  RSS feed

 
saikrishna cinux
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one simple doubt regarding performance
import java.util.Date;
import java.util.*;
I use Date class in my program so i generally use this java.util.*;
to import the class.
but in most of the programs who has developed in my company use this
java.util.Date;
I think by using the above one we can improve the performance by reducing the extra overhead.. by importing all the classes


am i right??

cinux
 
Mani Ram
Ranch Hand
Posts: 1140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is absolutely no difference in the performance during runtime. There might be a very very small difference during compilation time, but that difference is ofcourse - very very small
 
karthikeyan Chockalingam
Ranch Hand
Posts: 259
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same topic is discussed here too and a good explanation is available
http://www.coderanch.com/t/401957/java/java/import-statements-more-memory-than
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!