程序补充完整 interfaceRun{ voidrun(); } interfaceSwim{ (2分)//游泳抽象方法 } publicclassSportimplementsRun,Swim{ publicvoidrun(){ (2分)//参考运行结果补充输出流语句 }publicvoidswim(){ System.out.println("每周我都会去游泳馆游泳。"); } publicstaticvoidmain(String[]args){ Sporta=newSport(); a.run(); a.swim(); } }
时间: 2024-04-02 07:33:42 浏览: 91
基于改进的Diameter/EAP-MD5的SWIM认证方法
程序补充完整:
interface Run {
void run();
}
interface Swim {
void swim();
}
public class Sport implements Run, Swim {
public void run() {
System.out.println("我每天都会去晨跑。");
}
public void swim() {
System.out.println("每周我都会去游泳馆游泳。");
}
public static void main(String[] args) {
Sport a = new Sport();
a.run();
a.swim();
}
}
阅读全文