|
Don't worry, it's because java's security mechanism prevents mixed use of classes.
Before jdk-1.3, a special reference method of defaultnamespace was allowed to call classes without packages.
But this usage was immediately cancelled, it is probably too disgusting to look at it.
If it is allowed to use packageless classes directly, how to write import?
You think. If a class without a package can be called directly, it can be used directly without writing import, because it does not have a package name.
For people like me who do tests and write Test.java all over, once the classpath is set up, jvm knows which Test.java to use? You have nowhere to debug if you want to find a mistake.
In this case, reflection is a tricky trick. You should go to the manufacturer to ask for a packaged class. With reflection, if the manufacturer updates the API later, you will be very troublesome. All parts must be rewritten. |
|