
class student{
String name;
int age;
String classroom;
String interest;
public void tell(){
System.out.println("姓名:"+name+"\n年龄:"+age+"\n班级:"+classroom+"\n爱好:"+interest);
}
}
class teacher{
String name;
String specialty;
String curriculum;
int career;
public void speak(){
System.out.println("姓名:"+name+"\n专业方向:"+specialty+"\n教授课程:"+curriculum+"\n教龄:"+career);
}
}
public class kind{
public static void main(String[] args){
student show = new student();
show.name ="小明";
show.age = 18;
show.classroom = "c1班";
show.interest = "篮球";
show.tell();
System.out.println("\n");
teacher shows = new teacher();
shows.name ="王老师";
shows.specialty ="计算机";
shows.curriculum ="使用Java语言理解程序逻辑";
shows.career = 3;
shows.speak();
}
}