"Loop detected: type b cannot propagate / implement itself or one of its own member types" error

The following example below has two interfaces a and b:

interface a { void x();}
interface b extends a {void y();}

Now I implement the above interfaces as classes i and j.

class i implements a{
    void x(){
        //Some code;
    }
}

class j extends i implements b{
    void y(){
        //Some code;
    }
}

When compiling class j, I get the error "Detected loop: type b cannot extend / implement itself or one of its own member types." Can someone please help me understand the problem.

+4
source share
1 answer

It seems to me that the error is caused by the declaration of the class "j", extending "i", as well as implementing "b", which are children of the "a" interface.

: "j extends i" "j" "a" ; "j b" "a" "b" , b "a". .

0

All Articles