今天看到一个java类中定义了接口,写个备忘录,记录一下
package com.gxf.test; public class Test_interface {
public interface show{
public void show();
}
static class TestInterface implements show{ @Override
public void show() {
System.out.println("this is interface!"); } } public static void main(String []args){
TestInterface testInterface = new TestInterface();
testInterface.show();
}
}