diff --git a/em-oop/src/BasicCheck2.java b/em-oop/src/BasicCheck2.java new file mode 100644 index 0000000..e90d1a6 --- /dev/null +++ b/em-oop/src/BasicCheck2.java @@ -0,0 +1,12 @@ + +public class BasicCheck2 { + public static void main(String[] args) { + Student student = new Student(); + + student.studentId = 1; + student.name = "鈴木一郎"; + + student.printProfile(); + } + +} diff --git a/em-oop/src/Student.java b/em-oop/src/Student.java new file mode 100644 index 0000000..a668753 --- /dev/null +++ b/em-oop/src/Student.java @@ -0,0 +1,11 @@ + +public class Student { + int studentId; + String name; + + public void printProfile() { + System.out.println("学籍番号:" + this.studentId + " 名前:" + this.name); + + } + +}