How can a package hierarchy contain another package class

Sam :

I am not sure about the java.lang Hierarchy. How can it contain java.security.Permission class? Follow the link and search for java.security.Permission.

BackSlash :

It doesn't contain that class. It's there just to show that java.lang.RuntimePermission is derived from java.security.BasicPermission, which is derived from java.security.Permission.

The class contained in the java.lang package is java.lang.RuntimePermission, but that webpage shows you the full class hierarchy, even if those class are not contained in the java.lang package.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=475653&siteId=1