参数的重载问题
using System;using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication2
{
public class Student
{
public Student(int _number,string _name)
{
number = _number;
name = _name;
}
public int number = 0;
public string name =' ';
}
class Program
{
public static void Create(Student p)
{
List<Student> stu = new List<Student>();
{
stu.Add(new Student(1, "honey"));
stu.Add(new Student(2,"lover"));
}
for(int i=0;i<5;i++)
{
stu.Add(new Student(int.Parse(Console.ReadLine()),Console.ReadLine())); //输入字符串的格式不正确
}
foreach (Student s in stu)
{
Console.WriteLine(s);
}
}
static void Main(string[] args)
{
Student w = null;
Create(w);
}
}
}
大家帮忙看看注释那里出现的问题,怎么解决啊
[ 本帖最后由 heqinwu8 于 2009-9-9 19:25 编辑 ]