如果一个类派生自从Object派生的另一个类,那么“多重继承”是否属于“多重继承”。 [英] If one class is derived from another that is derived from Object, is that "multiple inheritence"

查看:103
本文介绍了如果一个类派生自从Object派生的另一个类,那么“多重继承”是否属于“多重继承”。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Java的事实是它不支持多重继承。

The fact about Java is that it does not support the multiple inheritance.

但我有一个问题,即所有java类的基类都是Object。

But I have a question that the base class of all java classes is Object.

现在我们有两个类:A类和B类.B继承自A然后B的Base类将是Object和A,所以这里,多重继承采取了地方。

Now we have two classes : Class A and Class B. B is inherited from A then the Base class of B would be the Object and A , so here, the multiple inheritance took place.

任何人都会帮我解决疑问吗?

Anyone will please help me to clear my doubt?

推荐答案

class B 继承自类 A ,后者继承自 Object Object 位于继承层次结构的顶部。这是多级继承,而不是多重继承。

class B inherits from class A which in turn inherits from Object. Object is at top of the inheritance hierarchy. This is multi level inheritance , not multiple inheritance.

这篇关于如果一个类派生自从Object派生的另一个类,那么“多重继承”是否属于“多重继承”。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆