接口和实现类通过implements关键字关联起来。举例:1、接口定义public interface IA{//定义一个接口IA public void show();//定义接口中的方法定义show}2、实现类public class A implements IA{//定义类A,通过implements实现接口IA public void show(){//实现show方法
System.out.println("IA"); }}补充:implements是一个类实现一个接口用的关键字,它是用来实现接口中定义的抽象方法。...
接口:StudentService实现类:StudentServiceImpl_1,StudentServiceImpl_2StudentService ss1 = new StudentServiceImpl_1();StudentService ss2 = new StudentServiceImpl_2();用同样的接口引用,声...