
教室、老师和学生java代码
ClassRoom.java
public class Main { public static void main(String args[]) { // TODO Auto-generated method stub System.out.println("教学活动从教室开始"); Teacher zhang=new Teacher(); Student jiang=new Student(); zhang.introduceSelf(); jiang.introduceSelf(); } }Teacher.java
public class Main { void introduceSelf(){ System.out.println("我是张老师"); } }Student.java
public class Main { void introduceSelf(){ System.out.println("我是学生,名字是:奖励"); } }运行结果:
👁️ 阅读量:0
© 版权声明:本文《教室、老师和学生java代码》内容均为本站精心整理或网友自愿分享,如需转载请注明原文出处:https://www.zastudy.cn/wen/1686842796a350862.html。