Javaコンパイラを使用すると、インターフェイス内にクラス定義を記述できます。これの具体的な用途はありますか?インターフェイス内のネストされたクラス
interface ClassInterface {
void returnSomething();
int x = 10;
class SomeClass {
private int y;
private void classDoingSomething() {
}
}
}
説明してください。
可能な複製:http://stackoverflow.com/questions/594789/practical-side-of-ability-to-define-a-class-within-an-interface-in-java –
可能な複製[インターフェイス内の内部クラス](0120-17753-1) – aioobe