类或对象继承 [英] Class or Object Inheritance

查看:93
本文介绍了类或对象继承的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我只是删除这个问题,如果它的教学欺骗学生或误导其他人。



以下哪一项是关于class?



(A)类可以同时包含构造函数和析构函数

(B)类是引用类型

(C)课程不支持继承

(D)以上所有都是真的









谢谢。

hi all i m just removing this question if its teaching cheat to students or misleading some others.

Which of the following is/are true about the class?

(A) Classes can have both constructors and destructors
(B) Classes are reference type
(C) Classes does not support Inheritance
(D) All of the above are true




Thanks.

推荐答案

答案是A和B ......



类可以有构造函数和析构函数。 (如果你可以构造它,你需要能够销毁它)

类是引用类型(值类型类似于int,long,short等)

DO 支持继承,它是OOP的基本概念。



我不确定辩论是什么。 C ++和C#都支持类的继承。我能想到的唯一辩论是C#不支持的多重继承和C ++。
The answer is A and B...

Classes can have constructors and destructors. (If you can construct it, you need to be able to destroy it)
Classes are reference types (value types are like int, long, short, etc)
Classes DO support inheritance, its a fundamental concept of OOP.

I'm not sure what the debate can be. C++ and C# both support inheritance on classes. The only debate I can think of is multiple inheritance which C# does not support and C++ does.


这篇关于类或对象继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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