Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is there any difference in package importing?

 
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