This article is a mirror article of machine translation, please click here to jump to the original article.

View: 15588|Reply: 1

[Communication] The use of angle brackets in c#, such <int>as List

[Copy link]
Posted on 1/28/2019 2:39:21 PM | | |
When designing a class, you want it to be able to handle different types of data
Then you need to use the type as a parameter.
For example<T>, List, the designer allows it to store multiple types of objects, represented by a T,
It is up to the user to decide what T is when it is used.
Generic class. Like what:
List class<T>, you can define it yourself:
These classes all support List methods, including: Add, Remove, Clear.

Angle brackets are also used in commissions
Action<int,string> indicates a delegate with an incoming parameter int and no return value for string





Previous:C# enumeration value increase feature description
Next:{ get; } in C#; set; What does it mean and how to use it?
Posted on 1/28/2019 2:50:54 PM |
Collection, generic
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com