| |

VerySource

 Forgot password?
 Register
Search
Author: wangkui_77

Ask a weak question: List

[Copy link]

0

Threads

9

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-26 21:45:01
| Show all posts
Learn
   <> Is it like the return type of a function? Or I don’t understand anything.
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-6-30 08:30:01
| Show all posts
Generics of C#
<T> indicates the type in the class table
You can use AarryList instead, eg:
AarryList list=new AarryList();
List.Add(1);
List.Add(2);

with
List<int> list=new List<int>();
List.Add(1);
List.Add(2);
it's the same
There is only a difference when converting:
Generics do not need to be converted, if you want to take List[0]
int i=List[0];

And AarryList:
int i=(int)List[0];
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list