This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
In terms of performance on compilation or run-time, is it strongly recommended that programmers should use import statement for the required classes only like using "import java.util.Map;" rather then using it for the whole package such as "import java.util.*;"? If so, what is the rationale behind?
It makes absolutely no performance difference at runtime, and no observable difference at compile time. Where it matters is not performance, but in the understandability and maintainability of the code. If you use very specific imports, or so the theory goes, then the person reading your code can very quickly understand where each class that's referred to comes from.
Personally, I find this rationale very weak in these days of powerful IDEs. If you're reading code in an IDE, it can tell you instantly what package any given class belongs to in an instant.
Another slightly more defensible position says that using very specific imports makes it clear what dependencies a class has. Again, tools can tell you this same information, but the imports do give you a good idea, at a glance.
It doesn't have anything to do with JIT. The import statements are just a direction for the compiler to find which class to use. Importing a "whole package" makes no difference in the resulting bytecode than importing a single class.