public class Student { public int age; //学生年龄 public String name; //学生姓名 public String degree; //学生学位 public void Student(int StudentAge, String StudentName)//得到姓名和年龄 { this.name = StudentName; this.age = StudentAge; } public static class Undergraduate extends Student{ public void Undergraduate(int StudentAge, String StudentName,String StudentDegree) { this.name = StudentName; this.age = StudentAge; this.degree = StudentDegree; } } public void show() //打印学生信息 { System.out.println("名字:"+this.name+"\n年龄:"+this.age+"\n学位:"+this.degree); } }
点赞 评论

相关推荐

点赞 评论 收藏
分享
门口唉提是地铁杀:之前b站被一个游戏demo深深的吸引了。看up主页发现是个初创公司,而且还在招人,也是一天60。二面的时候要我做一个登录验证和传输文件两个微服务,做完要我推到github仓库,还要我加上jaeger和一堆运维工具做性能测试并且面试的时候投屏演示。我傻乎乎的做完以后人家跟我说一句现在暂时不招人,1分钱没拿到全是白干
你的秋招第一场笔试是哪家
点赞 评论 收藏
分享
牛客网
牛客网在线编程
牛客网题解
牛客企业服务