📄 a.java
字号:
//Copyright (c) 1998, Arthur Gittleman
//This example is provided WITHOUT ANY WARRANTY either expressed or implied.
/* Public class A declares data fields and methods
* with each of the four access modifiers
* (including none) to illustrate their use.
* Class B, not public, will be visible only in the
* package visibility in which it is declared.
*/
package visibility;
public class A {
public int d1=1;
int d2=2;
protected int d3=3;
private int d4=4;
public int get1() {
return d1;
}
int get2() {
return d2;
}
protected int get3() {
return d3;
}
private int get4() {
return d4;
}
public int usePrivate(){
return d4 + get4();
}
}
class B {
public int d5=5;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -