“every class in java extends the MetaClass Object” does it imply that every subclass causes a Diamond issue

后端 未结 3 561
鱼传尺愫
鱼传尺愫 2020-12-18 16:23

These two facts in java

Fact 1

Every class in java by default extends the java meta class Object

and

Fact

3条回答
  •  鱼传尺愫
    2020-12-18 16:54

    “Every class in java by default extends the java meta class Object” //fact1

    Every Class extends Object class, only if they don't extend any other class directly.

    If a class Test extends another Sample class, then Test don't extends Object class directly, but, inheriting the Object class behaviors through super class Sample, which directly extends Object class.

提交回复
热议问题