diff --git a/em-oop/src/BasicCheck2.java b/em-oop/src/BasicCheck2.java index 3855268..f3dd18b 100644 --- a/em-oop/src/BasicCheck2.java +++ b/em-oop/src/BasicCheck2.java @@ -9,6 +9,7 @@ public class BasicCheck2 { // System.out.print("学籍番号"+student.studentId); // System.out.print("名前:" + student.name); student.printProfile(); + } } diff --git a/em-oop/src/Student.java b/em-oop/src/Student.java index 307bffb..1292ae4 100644 --- a/em-oop/src/Student.java +++ b/em-oop/src/Student.java @@ -2,20 +2,21 @@ public class Student { int studentId; String name; - + 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(); - } + //} }