1.创建接口:
public interface ITest {
void w();
}
2.创建实现类:
public class test2 implements ITest{
public static void main(String[] args) throws Exception {
//接口回调,接口声明,实现类实例化
ITest dd = new test2();
dd.w();
}
@Override
public void w() {
System.out.println("*****");
}
}