ミッション課題

This commit is contained in:
2026-09-18 10:28:27 +09:00
parent 439556d4cc
commit 9780db9a8f
5 changed files with 135 additions and 56 deletions

View File

@@ -1,14 +1,35 @@
public class BasicCheck2 {
public static void main(String[] args) {
Student student = new Student();
//
student.studentId = 1;
student.name = "鈴木一郎";
//
// System.out.print("学籍番号"+student.studentId);
// System.out.print("名前:" + student.name);
//Student型のstudentを宣言、インスタンスを代入する
Student student1 = new Student();
Student student2 = new Student();
Student student3 = new Student();
student1.studentId = 1;
student1.name = "鈴木一郎";
//studentIDに1,nameに鈴木一郎を代入
student2.studentId = 2;
student2.name ="田中花子";
student3.studentId = 3;
student3.name ="佐藤次郎";
//studentのprintProfileメソッドを呼び出す
student.printProfile();
}
}
//
//System.out.print("学籍番号"+student.studentId);
//System.out.print("名前:" + student.name);