import java.*;
Why cannot I do this importing ?? Instead of importing the all class in a particular sub-package of the package \'java\' , I tried t
Because import some.example.Type;
is only to import types not the packages. import some.example.*;
means you're importing all the Types contained inside some.example
package not the other packages inside it.
This is because import means the code of that file will be available for your program at run time and package itself doesn't contain any code. It contains files which have the code.
That's why you can't import all the built-in code in a single import statement. At max you can import in a single statement is all the code available in different files within a package and you know the way import some.example.*;