段階2

This commit is contained in:
m-shimizu
2026-09-15 13:51:34 +09:00
parent 7559a7dfa7
commit 357ad900a1
2 changed files with 8 additions and 6 deletions

View File

@@ -9,6 +9,7 @@ public class BasicCheck2 {
// System.out.print("学籍番号"+student.studentId);
// System.out.print("名前:" + student.name);
student.printProfile();
}
}

View File

@@ -6,16 +6,17 @@ public class Student {
public Student(int studentId, String name) {
this.studentId = studentId;
this.name = name;
}
public void printProfile() {
System.out.println("学籍番号:" + this.studentId + " 名前:" + this.name);
}
public static void main(String[] args) {
Student s = new Student(1,"鈴木一郎");
s.printProfile();
//public static void main(String[] args) {
//Student s = new Student(1,"鈴木一郎");
//s.printProfile();
}
//}
}