📄 orc.java
字号:
//: Orc.java
// The protected keyword
import java.util.*;
class Villain {
private int i;
protected int read() { return i; }
protected void set(int i) { this.i = i; }
public Villain(int i) { this.i = i; }
public int value(int m) { return m*i; }
}
public class Orc extends Villain {
private int j;
public Orc(int j) { super(j); this.j = j; }
public void change(int x) { set(x); }
public static void main(String[] args) {
Orc orc = new Orc(2);
orc.change(3);
System.out.println(orc.value(4));
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -