j3_15.java

来自「石志国著《JSP应用教程》」· Java 代码 · 共 21 行

JAVA
21
字号
class A{
	int value = 3;
	int getValue(){return value;}
}
class B extends A{
	int value = 6;
	int getValue() {return value;}
int getValue2(){return super.value;}
int getValue3(){return getValue();}
int getValue4(){return super.getValue();}
}
class Test{
	public static void main(String args[]){
		B b = new B();
		System.out.println(b.getValue());
		System.out.println(b.getValue2());
		System.out.println(b.getValue3());
		System.out.println(b.getValue4());
}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?