简体   繁体   English

Page_Load(对象发送者,EventArgs e)---为什么“对象”不大写?

[英]Page_Load(object sender, EventArgs e)---Why is “object” not capitalised?

"object" here should refer to the "Object" class. 这里的“对象”应指代“对象”类。 As with all class identifiers in the .NET framework, it is supposed to be capitalised although not case sensitive. 与.NET框架中的所有类标识符一样,尽管不区分大小写,但应该将其大写。 But I realise in c# it is not capitalised by default. 但是我意识到在C#中默认情况下它不是大写的。 Why is that? 这是为什么? Is it because C# is modelled after Java which had some sort of non capitalised object class? 是因为C#是仿照Java建模的,Java具有某种非大写的对象类? I can't remember Java syntax already. 我已经不记得Java语法了。

object is just a C# keyword that refers to the System.Object class. object只是引用System.Object类的C#关键字。 In just the same way, string is a keyword that refers to the System.String class. 以相同的方式, string是一个引用System.String类的关键字。 You can use the capitalized and non-capitalized versions interchangably, but it helps to highlight that these two classes are treated "specially" by the C# language (in that object is the default class that all classes inherit from, and string is the type of "xyz" constant expressions). 您可以互换使用大写字母和非大写字母的版本,但这有助于强调C#语言对这两个类进行了“特殊”处理(在该object中,所有类都继承自默认类,而string是以下类的类型) “ xyz”常量表达式)。

Also, C# is case-sensitive. 同样,C#区分大小写。 EventArgs is a different class to eventargs (say). EventArgs是与eventargs不同的类(例如)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 传递列表以与(对象发送者,EventArgs e)一起起作用 - Pass List to function with (object sender, EventArgs e) “对象发送者”和“EventArgs e”参数有什么用? - What is the use of “object sender” and “EventArgs e” parameters? 对象发件人和EventArgs - Object Sender and EventArgs 如何从对象发件人EventArgs e获取行索引 - How to get row index from object sender, EventArgs e 在事件处理程序中使用“对象发送者,EventArgs e” - Working with “object sender, EventArgs e” inside an Event Handler 如何调用具有参数的方法(对象发送者,EventArgs e) - How to call method having parameters (object sender, EventArgs e ) .Net事件-除onClick以外的事件在事件中使用什么(对象发送者,EventArgs e)参数 - .Net Events - What use (object sender, EventArgs e) parameters give in Events other than onClick 使用对象发送方和EventArgs调用方法c# - Call method c# with object sender and EventArgs 更新datagridview仅在具有(object sender,EventArgs e)参数的函数中起作用 - Updating datagridview only works inside functions with (object sender, EventArgs e) parameters 私有无效listBox1_SelectedIndexChanged(对象发送者,EventArgs e)的第一行总是收到错误 - Fisrt line of private void listBox1_SelectedIndexChanged(object sender, EventArgs e) always gets an error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM