using System; 
namespace _4_5_3 

    public class Student 
    { 
        private string strName;//域 
        public string Name // 1
    { 
    get{return this.strName;} 
    set{this.strName=value;} 
    } 
public Student(string _strName) //2 add black

this.strName=_strName; } 
~Student() 

Console.WriteLine("调用析构方法。"); } 
    } class Class1 

static void Main(string[] args) //void 3

Student s=new Student("张三"); 
Console.WriteLine(s.Name); 


解决方案 »

  1.   

    using System; 
    namespace _4_5_3 

        public class Student 
        { 
            private string strName;//域 
            public string Name;   //这里不应该有;号
        { 
        get{return this.strName;} 
        set{this.strName=value;} 
        } 
    public Student(string_strName) //这里string和_strName之间少了一个空格

    this.strName=_strName; } 
    ~Student() 

    Console.WriteLine("调用析构方法。"); } 
        } class Class1 

    static vodi Main(string[] args) //vodi错了应该是void

    Student s=new Student("张三"); 
    Console.WriteLine(s.Name); 


    } 暂时先看出来这三处,你行个好把错误提示贴出来好吗
      

  2.   

    static vodi Main(string[] args)
    static void Main(string[] args)
    - -!
      

  3.   

    你这代码是抄的吧,自己写的话不会把void写成vodi的吧。。要仔细啊!
      

  4.   

    嗯,写的一个例题  不小心把void 写错了
    以后要小心了,谢谢各位指教
      

  5.   

    装牛人?
    用手写,不用IDE?
      

  6.   

    using System; 
    namespace _4_5_3 

        public class Student 
        { 
            private string strName;//域 
            public string Name // 1
        { 
        get{return this.strName;} 
        set{this.strName=value;} 
        } 
    public Student(string _strName) //2 add black

    this.strName=_strName; } 
    ~Student() 

    Console.WriteLine("调用析构方法。"); } 
        } class Class1 

    static void Main(string[] args) //void 3

    Student s=new Student("张三"); 
    Console.WriteLine(s.Name);