Why some Java codes imports same package again?
import, java, playframework
Solution
Correct me if i'm wrong in imports concept.
You are.
Something like this:
import foo.bar.*;
only imports types from the `foo.bar` package. It doesn't import from "subpackages" such as `foo.bar.baz`.
It's very easy to test this:
import java.util.*;
class Test {
public void foo() {
Pattern p = null;
}
}
That won't compile, but if you add:
import java.util.regex.*;
then it will.
Java doesn't really think of packages as forming a hierarchy. We do, as humans, but as far as the Java language is concerned, the packages `java.util` and `java.util.regex` are entirely unrelated.
Problem
Possible Duplicate: Java import confusion When i read play frameworks documentation, I found this. ``` import play.*; import play.mvc.*; ``` In the first line itself they have imported all the classes under play package. Then what is the use of second line. Check this link. Go to 'Providing an application error page' section. Correct me if i'm wrong in imports concept.