3段階目

This commit is contained in:
m-shimizu
2026-09-16 13:42:09 +09:00
parent b3fd66606d
commit 23f5358254
2 changed files with 18 additions and 5 deletions

View File

@@ -2,11 +2,15 @@
public class Student {
int studentId;
String name;
static int studentCount = 0;
public Student(int studentId, String name) {
this.studentId = studentId;
this.name = name;
studentCount++;
}
public void printProfile() {
@@ -17,7 +21,10 @@ public class Student {
//s.printProfile();
//}
public static int getStudentCount() {
return studentCount;
}
}