In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article shows you how to operate the NET Framework anonymous class. The content is concise and easy to understand. It can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
.net Framework applications provide an environment for developers to deploy WEB applications. Based on this tool, we need to constantly accumulate experience from practice to slowly explore its meaning.
A new way to create a class is provided in C # 3.0 with the following code:
Var my = new
{
Field1 = "abcd"
Field2 = 12
}
MessageBox.Show (my.field1)
The C # compiler automatically infers that my is an object instance of a class with two public fields. That is, it is equivalent to the following code:
Public class MyClass {public String field1; public int field2;} var my = new MyClass (); my.field1 = "abcd"; my.field2 = 25; MessageBox.Show (my.field1)
It is mentioned in the * section that if a dynamic language changes the type of a variable in the process of assigning a value to a variable, if it is converted to a strongly typed language. One way, of course, is to declare the variable as an object type, or to use the .NET Framework anonymous class to solve this problem. The code is as follows:
Var myVar = new {field_string = "abcd" field_int = 12;}
Then the. NET Framework anonymous class decides which class field to use based on the type currently used by this variable
The above is how the .NET Framework anonymous class works. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.