Skip to content

Commit 9a1dd5e

Browse files
author
xiachaochao
committed
java1995 test interface
1 parent c28a1dd commit 9a1dd5e

4 files changed

Lines changed: 30 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package com.java1995.testinterface;
2+
3+
public class FatFat implements IFight {
4+
public void fight(){
5+
System.out.println("胖人打人疼");
6+
}
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.java1995.testinterface;
2+
3+
public class FightImpl{
4+
public static void main(String[] args){
5+
IFight i1 =new FatFat();
6+
i1.fight();
7+
IFight i2 =new Thinthin();
8+
i2.fight();
9+
}
10+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package com.java1995.testinterface;
2+
3+
public interface IFight {
4+
public void fight();
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.java1995.testinterface;
2+
3+
public class Thinthin implements IFight {
4+
public void fight(){
5+
System.out.println("瘦人打人不疼");
6+
}
7+
8+
}

0 commit comments

Comments
 (0)