package com.nowcode.www.demo03; public class Student {     protected String name;     protected int age;     public Student(){              }     public Student(String name,int age){         super();         this.name=name;         this.age=age;     }     public void show(){         System.out.println("name:"+name+"age:"+age);     } } class Undergraduate extends Student{     private String degree;     public Undergraduate(){              }     public Undergraduate(String name, int age,String degree) {         super(name, age);         this.degree=degree;     }     public void show(){         System.out.println("name:"+name+"age:"+age+"degree:"+degree);     } }
点赞 评论

相关推荐

八极星:我看成了化身一团黑子哈哈哈😂
点赞 评论 收藏
分享
努力成为C语言高手:质疑大祥老师,理解大祥老师,成为大祥老师
点赞 评论 收藏
分享
牛客网
牛客企业服务