Does Java support Mulitiple Inheritance?

后端 未结 5 1849
半阙折子戏
半阙折子戏 2021-01-25 15:03

From the Java fact that all class in Java have a parent class as Object. But the same Java says that it doesn\'t support multiple inheritance. But what this code me

5条回答
  •  难免孤独
    2021-01-25 15:40

    Java does not support Multiple Inheritance by a developer. Behind the scenes, the compiler ensures everything extends Object.

    Basically, the compiler will modify

    public Class A extends Object, B to practically be Class A extends B and Class B extends Object.

提交回复
热议问题