?? 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 + -