//1.创建接口publicinterfaceUSB{//接口中没有构造方法,写了就报错//成员常量publicstaticfinalint NUM =10;//成员方法//JDK7及以前的写法publicabstractvoidopen();publicabstractvoidclose();//JDK8多了两种写法publicstaticvoidmethod1(){}publicdefaultvoidmethod2(){}//JDK9多了一种写法privatevoidmethod3(){}}//测试接口publicclassTestDemo2{publicstaticvoidmain(String[] args){
System.out.println(USB.NUM);}}