复制代码 代码如下:
1 class Employee
2 {
3 private List<Employee> empList = new List<Employee>();
4 }
复制代码 代码如下:
class Employee
{
//声明变量的同时进行初始化
private List<Employee> empList = new List<Employee>();
public Employee()
{
}
public Employee(int size)
{
empList = new List<Employee>(size);
}
}
复制代码 代码如下:
class Employee
{
//声明变量
private List<Employee> empList;
public Employee()
{
empList = new List<Employee>();
}
public Employee(int size)
{
empList = new List<Employee>();
empList = new List<Employee>(size);
}
}
复制代码 代码如下:
class Employee
{
//声明变量
private List<Employee> empList;
public Employee()
{
empList = new List<Employee>();
}
public Employee(int size)
{
empList = new List<Employee>(size);
}
}
新闻热点
疑难解答
图片精选