Day3、2段階目完了

This commit is contained in:
m-endo
2026-09-18 14:08:32 +09:00
parent 2fe57b16c1
commit cc5ae0b0b8
2 changed files with 8 additions and 5 deletions

View File

@@ -3,13 +3,15 @@ public class Day3Check2 {
public static void main(String[] args) {
//インスタンス
Rectangle width = new Rectangle(3);
Rectangle height = new Rectangle(4);
Rectangle rect = new Rectangle(3.0,4.0);
//メソッド呼び出し
width.showInfo;
height.showInfo;
rect.showInfo();
//戻り値出力
//Greeting greeting = new JapaneseGreeting();
//System.out.println();
//インスタンスを代入
Greeting greeting = new JapaneseGreeting();
System.out.println();
System.out.println(greeting.hello());
}
}

View File

@@ -5,6 +5,7 @@ public abstract class Shape {
//コンストラクタ
public Shape(String name) {
this.name = name;
}
//メソッド1(抽象メソッド)