Cyclic inheritance when implementing inner interface in enum

This would be because you are implementing (coding) the interface you are implementing (inheriting) inside of the class that is inheriting from that class.

I wish I could make that sentence better…

But here is a visual example.

Class A implements Interface B {

    Interface B {
    }
}

As far as I know, this is not allowed. You need to define the interface outside of the class (in this case, an Enum).

Like so:

Interface B {
}

Class A implements Interface B {
}

Best practice is probably to break them up into different files.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)