JAVA的接口多态
1 interface dao { 2 public static final int i = 10; 3 4 public void add(); 5 public void delete(); 6 } 7 8 class userDao implements dao { 9 // 实现接口中的方法 10 @Override 11 public void add() { 12 System.out.println("增加成员成功"); 13 } 14 15 @Override 16 public void delete() { 17 System.out.println("删除成员成功"); 18 } 19 } 20 21 public class Demo { 22 public static void main(String[] args) { 23 dao d = new userDao(); 24 d.add(); 25 } 26 }