泛型练习1
来源:互联网 发布:阿里云好还是腾讯云好 编辑:程序博客网 时间:2024/04/29 10:32
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace 练习
{
class Program
{
static void Main(string[] args)
{
Thread t = new Thread(N);
t.Start();
}
public static void N()
{
List<Student> list = new List<Student>();
list.Add(new Student("老孙"));
list.Add(new Student("老zhu"));
for (int i = 0; i < list.Count; i++)
{
list[i].name = "李四";
//Console.WriteLine(list[i].name);
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace 练习
{
class Program
{
static void Main(string[] args)
{
Thread t = new Thread(N);
t.Start();
}
public static void N()
{
List<Student> list = new List<Student>();
list.Add(new Student("老孙"));
list.Add(new Student("老zhu"));
for (int i = 0; i < list.Count; i++)
{
list[i].name = "李四";
//Console.WriteLine(list[i].name);
}
foreach (var item in list)//list 在这里是一种类型,所以要用item.name
{
Console.WriteLine(item.name);
}
}
}
public class Student
{
public string name;
public Student(string name)
{
this.name = name;
}
}
Console.WriteLine(item.name);
}
}
}
public class Student
{
public string name;
public Student(string name)
{
this.name = name;
}
}
}
0 0
- 泛型练习1
- 泛型练习1(from李兴华)
- 泛型练习2
- 泛型练习3
- 泛型练习5
- JAVA 泛型练习
- delphi2010泛型练习
- 集合、泛型简单练习
- 【SICP练习】1 练习1.1-练习1.5
- C3第 1 节: 泛型集合及练习
- 练习1
- 练习1
- 练习1
- 练习1
- 练习。。。。。。1
- 练习1
- 练习1
- 练习1
- 移动端meta常用参数
- Cygwin (64-bit)绿色版
- 关于Android adb 调试程序解决小米MIUI的INSTALL_FAILED_UPDATE_INCOMPATIBLE的安装错误
- jvm笔记3--性能监控与故障处理工具
- 关于RSA密钥生成方法
- 泛型练习1
- 文法和语言
- CodeForces 548D (单调栈+伪DP)
- 简单的排序算法
- mongodb 索引
- iOS - UINavgationController中preferredStatusBarStyle方法不执行的问题
- Android系统源码阅读(8):Content Provider数据传输过程
- IONIC键盘弹出防止页面Header(title位置)自动上移位置(消失)
- string & cstring