我有几个接口都只有一个方法,它们都非常相似。我知道它有效,但我应该还是不应该像这样对它们进行分组:
public class InterfaceGroup {
public interface Type1 {
public void method(int a);
}
public interface Type2 {
public void method(String s);
}
public interface Type3 {
public void method();
}
}
然后在外部将它们引用为InterfaceGroup.Type1
.