理论上讲 , 没有任何理由认为这是不合法的。只是这有违于将接口作为抽象规范的初衷 。
interface inter{
/* 如下注释的代码报错:
* This method requires a body instead of a semicolon
* 此方法需要体而不是分号
*/
//public static void print();
//可以增加静态方法
public static void get(){
}
}
理论上讲 , 没有任何理由认为这是不合法的。只是这有违于将接口作为抽象规范的初衷 。
interface inter{
/* 如下注释的代码报错:
* This method requires a body instead of a semicolon
* 此方法需要体而不是分号
*/
//public static void print();
//可以增加静态方法
public static void get(){
}
}