Kompilator java pozwala mi pisać definicję klasy wewnątrz interfejsu. Czy są jakieś konkretne zastosowania tego?Zagnieżdżona klasa wewnątrz interfejsu
interface ClassInterface {
void returnSomething();
int x = 10;
class SomeClass {
private int y;
private void classDoingSomething() {
}
}
}
Proszę wyjaśnić.
możliwy duplikat: http://stackoverflow.com/questions/594789/practical-side-of-the-define-a-class-within-an-interface-in-java –
możliwy duplikat [ wewnętrzna klasa w interfejsie] (http://stackoverflow.com/questions/2400828/inner-class-within-interface) – aioobe