import com.sun.org.apache.xpath.internal.objects.XString; import java.util.ArrayList; import java.util.Arrays; class student{ private String name; private String classes; private double score; public student(String name, String classes, double score) { this.name = name; this.classes = classes; this.score = score; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getClasses() { return classes; } public void setClasses(String classes) { this.classes = classes; } public double getScore() { return score; } public void setScore(double score) { this.score = score; } @Override public String toString() { return "student{" + "name='" + name + ''' + ", classes='" + classes + ''' + ", score=" + score + '}'; } } public class textdome { public static void main(String[] args) { ArrayListstudents=new ArrayList<>(); students.add(new student("zhansan","4",98.9)); students.add(new student("lishi","4",98.8)); students.add(new student("wanmazi","4",98.7)); System.out.println(students); } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)