重载程序的问题
using System;using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication2
{
public class Student
{
private string strName;
public string Name
{
get { return this.strName; }
set { this.strName = value; }
}
}
public class CollegeStudent : Student
{
static void Main()
{
private string strName;
public string Name
{ get { return this.strName; }
set {if(value !="")this .strName=value ; }
}
}
}
请问这程序的错误在哪里? --------------------编程问答-------------------- 1。属性不应写在 static void main() 方法中。
2.在方法中定义局部变量不需要使用 public,private 限制访问关键字。
--------------------编程问答-------------------- 一塌糊涂,找本基础的书看一下吧;
补充:.NET技术 , C#