Java : Class inheriting self

后端 未结 8 1837
悲&欢浪女
悲&欢浪女 2021-02-15 11:21

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:34

    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

提交回复
热议问题