diff --git a/em-oop/src/BasicCheck2.java b/em-oop/src/BasicCheck2.java new file mode 100644 index 0000000..3b5dbbc --- /dev/null +++ b/em-oop/src/BasicCheck2.java @@ -0,0 +1,10 @@ + +public class BasicCheck2 { + public static void main(String[] args) { + Student student = new Student(); + student.studentId = 1; + student.name = "鈴木一郎"; + student.printProfile(); + } + +} \ No newline at end of file diff --git a/em-oop/src/Student.java b/em-oop/src/Student.java new file mode 100644 index 0000000..436c2f0 --- /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); + + } + +}