24 lines
400 B
Java
24 lines
400 B
Java
|
|
public class Student {
|
|
int studentId;
|
|
String name;
|
|
|
|
public void printProfile() {
|
|
System.out.println("学籍番号:" + this.studentId + " 名前:" + this.name);
|
|
}
|
|
|
|
public Student(int studentId, String name) {
|
|
this.studentId = studentId;
|
|
this.name = name;
|
|
|
|
studentCount++;
|
|
|
|
}
|
|
static int studentCount = 0;
|
|
|
|
public static int getStudentCount() {
|
|
return studentCount;
|
|
}
|
|
|
|
}
|