展开全部
可以重写Student类中的toString()方法,以下例子62616964757a686964616fe58685e5aeb931333365653765仅作为参考:class Student
{
//该类的实例变量
public String no;
public String name;
public String sex;
public int yuwen;
public int shuxue;
public int yingyu;
public int lizong;
//创建构造器
public Student(String no , String name , String sex , int yuwen , int shuxue , int yingyu , int lizong){
this.no = no;
this.name = name;
this.sex = sex;
this.yuwen = yuwen;
this.shuxue = shuxue;
this.yingyu = yingyu;
this.lizong = lizong;
}
//重写toString()方法,该方法输出对象
public String toString(){
return “Student[no: ” + no + ” , name: ” + name +” , sex: ” + sex + ” , yuwen: ”