📄 packagevisibility.java
字号:
/* This example demonstrates "default package visibility". * Foo is defined in the same directory as PackageVisibility. * Thus, only the Foo private attribute privateInt is really * private. PackageVisibility sees all three other variables. */public class PackageVisibility{ public static void main(String args[]) { Foo foo = new Foo(); int fooPublic = foo.publicInt; // public int fooPackage = foo.packageInt; // package int fooProtected = foo.protectedInt; // default package // Following is not visible, would cause compiler error// int fooPrivate = foo.privateInt; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -