package zhang;
class Person{
String name;
String sex;
int age;
void getInfo(String n,String s,int a){
name=n;
sex=s;
age=a;
}
void showInfo(){
System.out.println("姓名:"+name);
System.out.println("性别:"+sex);
System.out.println("年龄:"+age);
}
}
public class student extends Person {
String id;
String school;
void setInfo(String s,String i){
id=i;
school=s;
}
void outInfo(){
System.out.println("姓名:"+name);
System.out.println("性别:"+sex);
System.out.println("年龄:"+age);
System.out.println("学校:"+school);
System.out.println("学号:"+id);
}
public static void main(String[] args) {
System.out.println("第一个人的信息");
student zhang=new student();
zhang.name="小明";
zhang.sex="男";
zhang.age=18;
zhang.id="21";
zhang.school="GGC";
zhang.showInfo();
System.out.println("第一个人的信息");
student li=new student();
li.getInfo("小静","女",17);
li.setInfo("GGC","10");
li.outInfo();
}
}