Java access rights

public

Classes in the same package or in different packages can be accessed freely

private

Can only be used in this class

Default (do not write permission modifier, that is, default permission)

Free access in the same package

Package import

When using classes in other packages, you no longer need to use the full name

Import a single class

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>