Day3、2段階目完了
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ public abstract class Shape {
|
||||
|
||||
//コンストラクタ
|
||||
public Shape(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
//メソッド1(抽象メソッド)
|
||||
|
||||
Reference in New Issue
Block a user