public class SchoolClass { private int id; // 编号 private String className; // 班级名称 private String calssDesc; // 备注 public SchoolClass() { super(); // TODO Auto-generated constructor stub } public SchoolClass(String className, String calssDesc) { super(); this.className = className; this.calssDesc = calssDesc; } public SchoolClass(int id, String className, String calssDesc) { super(); this.id = id; this.className = className; this.calssDesc = calssDesc; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getClassName() { return className; } public void setClassName(String className) { this.className = className; } public String getCalssDesc() { return calssDesc; } public void setCalssDesc(String calssDesc) { this.calssDesc = calssDesc; } @Override public String toString() { return className; } }
时间: 2024-04-04 11:34:14 浏览: 50
Java swing实现学生信息管理系统源码.zip
这是一个Java类,名为SchoolClass,它有三个属性:id、className和calssDesc,分别表示班级的编号、名称和备注。它有三个构造函数,分别是无参构造函数、带有两个参数的构造函数,以及带有三个参数的构造函数。它还有一些getter和setter方法,用于获取和设置属性值。最后,它还重写了toString()方法,返回班级名称。
阅读全文