关于接口

interface B1{};
interface B2{};
class A implements B1,B2{

}
B1 b = new A();
B2 b2 = (B2)b;

是合法的。这就是接口的多态。

posted @ 2018-11-01 11:16  寒潭渡鹤影  阅读(82)  评论(0编辑  收藏  举报