Files
em-oop/CUI_EM_OOP/src/Student.java
2026-10-20 16:38:29 +09:00

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;
}
}