Java : Class inheriting self

后端 未结 8 1312
刺人心
刺人心 2021-02-15 11:19

I know this is pointless: I just find it funny and I want to inquire more about the mechanics of what happens when you create a class that inherits itself, resulting in a stack

8条回答
  •  生来不讨喜
    2021-02-15 11:37

    Try in an IDE like eclipse, it wont allow you to do so. ie gives an error like this.

    Cycle detected: the type Test cannot extend/implement itself or one of its own member types

提交回复
热议问题