本文介绍了什么是重载方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是方法重载的类型?由于方法隐藏是引用类型而方法覆盖是对象类型。



我尝试过:



什么是Method重载类型?由于方法隐藏是引用类型而方法覆盖是对象类型。

what is type of Method overloading?. Since Method hiding is Reference type and Method overriding is Object type.

What I have tried:

what is type of Method overloading?. Since Method hiding is Reference type and Method overriding is Object type.

推荐答案

引用:

方法隐藏是引用类型

虽然你可以隐藏值类型的方法,因为你不能从值类型派生,不是方法隐藏的一些特殊属性。

While you can hide methods on Value types that's because you can't derive from a value type, not some special property of method hiding.

Quote:

方法覆盖是对象类型。

Method overriding is Object type.

这没有任何意义 - 对象是一个Type,但只是在它是C#中所有类的基类型的意义上。您可以覆盖一个方法而不需要任何对Object类的引用。

That doesn't make any sense - an object is a Type, but only in the sense that it's the base type for all classes in C#. You can override a method without any reference to the Object class at all.

Quote:

什么是Method类型超载?

what is type of Method overloading?

没有比最重要的声明更有意义...



我建议你重新阅读你的作业问题和你的课程笔记 - 你好像错过了一点。

Makes no more sense than the overriding statement did...

I'd suggest you re-read your homework question and your course notes - you seem to have missed the point a bit.


这篇关于什么是重载方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-01 18:33