package libaries;
public interface arithmetic<Key> {
static Key add(Key a, Key b) { return null; }
void add(Key a);
void minus(Key a);
}
这样写idea会报错'libaries.arithmetic.this' cannot be referenced from a static context
package libaries;
public interface arithmetic<Key> {
static Key add(Key a, Key b) { return null; }
void add(Key a);
void minus(Key a);
}
这样写idea会报错'libaries.arithmetic.this' cannot be referenced from a static context
接口中的方法不能使用static,接口中的方法默认是public,abstract,与static是冲突的。