It is clear that all import statements must follow the package statement, if any, and precede the rest of the compilation unit. Other than that, I can't think of a case where the order of import statements within a compilation unit has meaning.
There are style preferences but no technical reasons that I know of. The Eclpise IDE has a nice "source/organize imports" feature on the right mouse click. It separates JDK imports and other imports by a blank line, sorts both groups, removes any that are not used and changes * to a list of classes. I figure the Eclipse guys gave it more thought than I care to and just use the default style.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com