📄 superdemo2.java
字号:
/**
*super keyword
*2004.11.17. xhcprince
*/
class That
{
protected String nm()
{
return "That";
}
}
class More extends That
{
protected String nm()
{
return "More";
}
protected void printNM()
{
That sref = (That)this;
System.out.println("this.nm() = " + this.nm());
System.out.println("sref.nm() = " + sref.nm());
System.out.println("super.nm() = " + super.nm());
}
}
class superDemo2
{
public static void main(String args[])
{
More more = new More();
more.printNM();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -