[英]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.