From e6753a16f4c421c4606e942462a87fa9bba7cafd Mon Sep 17 00:00:00 2001 From: s-ohasi <26-o-m-stella-tecnica@it-college.jp> Date: Mon, 14 Sep 2026 17:19:34 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=EF=BC=92=E6=AE=B5=E9=9A=8E=E7=9B=AE?= =?UTF-8?q?=E5=AE=8C=E4=BA=86=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- em-oop/src/BasicCheck2.java | 14 ++++++++++++++ em-oop/src/Student.java | 6 ++++++ 2 files changed, 20 insertions(+) create mode 100644 em-oop/src/BasicCheck2.java create mode 100644 em-oop/src/Student.java diff --git a/em-oop/src/BasicCheck2.java b/em-oop/src/BasicCheck2.java new file mode 100644 index 0000000..07a0e25 --- /dev/null +++ b/em-oop/src/BasicCheck2.java @@ -0,0 +1,14 @@ + +public class BasicCheck2 { + + public static void main(String[] args) { + // TODO 自動生成されたメソッド・スタブ + Student st = new Student(); + + st.studentId=1; + st.name="鈴木一郎"; + + System.out.println("学籍番号:" + st.studentId + " 名前:" + st.name); + } + +} diff --git a/em-oop/src/Student.java b/em-oop/src/Student.java new file mode 100644 index 0000000..8dce947 --- /dev/null +++ b/em-oop/src/Student.java @@ -0,0 +1,6 @@ + +public class Student { + int studentId; + String name; + +} From 542af2a5d4c71f75414195cb9f2462709397aea4 Mon Sep 17 00:00:00 2001 From: s-ohasi <26-o-m-stella-tecnica@it-college.jp> Date: Tue, 15 Sep 2026 14:58:52 +0900 Subject: [PATCH 2/3] =?UTF-8?q?2=E6=AE=B5=E9=9A=8E=E7=9B=AE=E5=AE=8C?= =?UTF-8?q?=E4=BA=86=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- em-oop/src/BasicCheck2.java | 8 ++++---- em-oop/src/Student.java | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/em-oop/src/BasicCheck2.java b/em-oop/src/BasicCheck2.java index 07a0e25..179ea98 100644 --- a/em-oop/src/BasicCheck2.java +++ b/em-oop/src/BasicCheck2.java @@ -3,12 +3,12 @@ public class BasicCheck2 { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ - Student st = new Student(); + Student student = new Student(); - st.studentId=1; - st.name="鈴木一郎"; + student.studentId=1; + student.name="鈴木一郎"; - System.out.println("学籍番号:" + st.studentId + " 名前:" + st.name); + student.printProfile(); } } diff --git a/em-oop/src/Student.java b/em-oop/src/Student.java index 8dce947..ea154eb 100644 --- a/em-oop/src/Student.java +++ b/em-oop/src/Student.java @@ -3,4 +3,8 @@ public class Student { int studentId; String name; + public void printProfile() { + System.out.println("学籍番号:" + this.studentId + " 名前:" + this.name); + + } } From 48af3a3a990b445435d17acf5ed48b302f2a1f5d Mon Sep 17 00:00:00 2001 From: s-ohasi <26-o-m-stella-tecnica@it-college.jp> Date: Wed, 16 Sep 2026 16:35:38 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E7=AC=AC=E4=B8=80=E6=AE=B5=E9=9A=8E?= =?UTF-8?q?=E5=AE=8C=E4=BA=86=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- em-oop/src/Circle.java | 25 +++++++++++++++++++++++++ em-oop/src/Day3Check1.java | 15 +++++++++++++++ em-oop/src/Shape.java | 22 ++++++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 em-oop/src/Circle.java create mode 100644 em-oop/src/Day3Check1.java create mode 100644 em-oop/src/Shape.java diff --git a/em-oop/src/Circle.java b/em-oop/src/Circle.java new file mode 100644 index 0000000..9097f3b --- /dev/null +++ b/em-oop/src/Circle.java @@ -0,0 +1,25 @@ + +public class Circle extends Shape { + + //Shapeクラスを継承 + + //フィールド作成 + private double radius; + + //コンストラクタ作成 + public Circle(double radius) { + super("円"); + this.radius = radius; + } + + //メソッド作成 + public double area() { + return Math.PI * radius * radius; + } + + public void showInfo() { + super.showInfo(); + System.out.println("(半径:" + this.radius + ")"); + } + +} diff --git a/em-oop/src/Day3Check1.java b/em-oop/src/Day3Check1.java new file mode 100644 index 0000000..814f6a7 --- /dev/null +++ b/em-oop/src/Day3Check1.java @@ -0,0 +1,15 @@ + +public class Day3Check1 { + + public static void main(String[] args) { + + //インスタンス作成 + Circle c = new Circle(2); + + //メソッド呼び出し + c.showInfo(); + + + } + +} diff --git a/em-oop/src/Shape.java b/em-oop/src/Shape.java new file mode 100644 index 0000000..29a87d1 --- /dev/null +++ b/em-oop/src/Shape.java @@ -0,0 +1,22 @@ + +public class Shape { + + //フィールド作成 + private String name; + + //コンストラクタ作成 + public Shape(String name) { + } + + //メソッド作成 + double area() { + return 0.0; + } + + //メソッド作成 + void showInfo() { + //出力 + System.out.println(this.name + "の面積は" + this.area() + "です"); + } + +}