📄 c.java
字号:
//Copyright (c) 1998, Arthur Gittleman
//This example is provided WITHOUT ANY WARRANTY either expressed or implied.
/* Class C in the same package as A and B
* can use A, B and all data fields and methods
* except the private d4 and getd4().
*/
package visibility;
public class C {
public static void main(String [] args) {
A a = new A();
B b = new B();
int i,j;
i = a.d1 + a.d2 + a.d3 + b.d5 + a.usePrivate();
j = a.get1() + a.get2() + a.get3();
System.out.println("i is " + i + " and j is " + j);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -