第一段階完了しました。
This commit is contained in:
22
em-oop/src/Shape.java
Normal file
22
em-oop/src/Shape.java
Normal file
@@ -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() + "です");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user