To maximize flexibility in an application , other objects can now refer to the interface type 为了使应用程式的灵活性最大化,其他物件现在可以引用介面类型(
You can then refer to implementing objects as that interface type and call whatever methods exist on that interface 然后就可以按照介面类型引用实作此介面的物件,并呼叫这个介面中存在的任何方法。
One way to capture the power of polymorphism in the java language is to declare an interface type and have other types implement that interface 在java语言中利用多态性的方式之一是宣告一个介面类型,并让其他类型实作这个介面。