public class { public static void main(String args[]){ classStart is =new classStart (); interfaceStart i = (interfaceStart )is; i.start(); } } interface interfaceStart { public void start(); } class classStart implements interfaceStart{ public void start(){ System.out.println("word..start"); } }
为什么将classStart类强制转换为interfacestart接口后,还可以调用start方法