标题:哪位大神帮忙看哈错误啊,小弟对这块不是很懂啊
取消只看楼主
雪月
Rank: 1
来 自:甘肃兰州
等 级:新手上路
帖 子:13
专家分:0
注 册:2012-11-19
结帖率:33.33%
已结贴  问题点数:20 回复次数:1 
哪位大神帮忙看哈错误啊,小弟对这块不是很懂啊
namespace person
{
    public class Person
    {
        public string Name;
        public int Age;
        public Person(string name, int age)
        {
            this.Name = name;
            this.Age = age;
        }
        public void  ShowInfo()

        {
              //  Console.RriteLine(name,age);
                Console.WriteLine("Name is:{0}",Name);
                Console.WriteLine("Age is:{1}",Age);
                return ;
            
        }


  
        public class Student:Person
        {
          //  public string Name;
           // public int Age;
            public int Number;
        
            public  Student(string name,int age , int number):base(name, age)
            {
                this.Name = name;
                this.Age = age;
                this.Number = number;
            }
            public  void ShowNum(int number)
            {
            //    Console.ReadLine(number);
                Console.WriteLine("number is:{2}".Number);
            }
        
        }

    }


  class Program
    {
        static void Main(string[] args)
        {
            Person per = new Person("肖惜淼",22);
            Person.ShowInfo();

        }
    }
}
搜索更多相关主题的帖子: person public return 
2013-11-19 23:45
雪月
Rank: 1
来 自:甘肃兰州
等 级:新手上路
帖 子:13
专家分:0
注 册:2012-11-19
得分:0 
回复 2楼 qw1161748579
灰常感谢你,不过在Number那还有个错误

错误    1    “string”并不包含“Number”的定义    person\person\Program.cs    43    51    person
搞不清楚为撒,我明明定义的是  int

永不言弃>-<持之以恒
2013-11-20 22:41



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-423833-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.198829 second(s), 10 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved