package a;
public class Student{
public static void main(String args[]){
private int stuId;
private String name;
//其它属性省略,方法同上。
public Student(){
//默认构造方法
}
public void setStuId(int stuId){
this.stuId=studId;
}
public void setName(String name){
this.name=name;
}
public int getStuId(){
return this.stuId;
}
public String getName(){
return this.name;
}
public String toString(){
}
}
}
package b;
public class Teacher(){
Student stu=new Student();
}
太多了,多少方法呢?极简单又麻烦
以上回答你满意么?