3日目2段階目完了しました。
This commit is contained in:
11
em-oop/src/Day3Check2.java
Normal file
11
em-oop/src/Day3Check2.java
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
public class Day3Check2 {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
Rectangle r = new Rectangle(3, 4);
|
||||||
|
r.showInfo();
|
||||||
|
Greeting gre = new JapaneseGreeting();
|
||||||
|
System.out.println(gre.hello());
|
||||||
|
}
|
||||||
|
}
|
||||||
5
em-oop/src/Greeting.java
Normal file
5
em-oop/src/Greeting.java
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
public interface Greeting {
|
||||||
|
String hello();
|
||||||
|
}
|
||||||
|
|
||||||
10
em-oop/src/JapaneseGreeting.java
Normal file
10
em-oop/src/JapaneseGreeting.java
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
//
|
||||||
|
public class JapaneseGreeting implements Greeting{
|
||||||
|
@Override
|
||||||
|
public String hello() {
|
||||||
|
// TODO 自動生成されたメソッド・スタブ
|
||||||
|
return "こんにちは";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user