Suppose class A extends class B and class B extends class A. then it will be known as cyclic inheritance.
e.g.
[1]
public class A extends B {
// some code
}
class B extends A {
// some code
}
[2]
public class A extends B {
// some code
}
public class B extends C {
// some code
}
public class C extends A {
// some code
}
[3]
public class A extends A {
// some code
}
error: cyclic inheritance involving.
e.g.
[1]
public class A extends B {
// some code
}
class B extends A {
// some code
}
[2]
public class A extends B {
// some code
}
public class B extends C {
// some code
}
public class C extends A {
// some code
}
[3]
public class A extends A {
// some code
}
error: cyclic inheritance involving.
No comments:
Post a Comment