I have gone through the following link Why would a static nested interface be used in Java?.
In my code base I have:
public interface I1{
public static interface I2 {
public void doSomething();
}
//some other methods
public void myMethod(I2 myObject);
}
And in some other class in a different package :
public abstract class SomeClass implements I2{
//mandatory method...
}
Now, my question is - "Is it really a good design to put I2
in I1
"?
EDIT :
public interface XClientSession {
static public interface OnQueryResultSentListener {
public void onQueryResultSent(XQueryResult result);
}
public void setOnQueryResultSentListener(OnQueryResultSentListener listener);
}
/ And in a different file I have...
public abstract class XAppAgentBase extends IntentService
implements XClient, OnQueryResultSentListener {
}