What is Java in the default system package?


Studying the URLConnection class, I came across a link to the default system package in the API docs for the URL class.

Does anyone know what it is?
Thanks.

+6
java
source share
2 answers

The default package is basically no package. If you must omit the package declaration when defining a new class. The difference seems to be the word "system." Looking through the implementation of URL.class in rt.jars, it seems we check sun.net.www.protocol I would suggest that this is the default system package to which it refers.

Again, the default package "system" by default implies the difference between the default package.

Keep in mind that sun.net.www.protocol is only valid for a specific Sun JVM implementation.

0
source share

I believe this means a system-dependent package name that is used as a URLStreamHandler when the first two steps cannot find a suitable URLStreamHandler . It is not associated with the default package.

+2
source share

All Articles