62,612
社区成员
发帖
与我相关
我的任务
分享
class Superclass{
public Superclass(){
interestingMehod();
}
void exampleMethod(){
interestingMehod();
}
private void interestingMehod(){ //注释
System.out.println(
"Superclass's interesting method.");
}
}
class Subclass extends Superclass{
public Subclass(){
interestingMehod();
}
public void interestingMehod(){
System.out.println(
"Subclass' interesting method.");
}
}
//Test.java
public class Test{
public static void main(String[] args){
Subclass me = new Subclass();
me.exampleMethod();
}
}