新手求解 namespace 类的应用_猫_ { class Class1 { public int weight; public string color; public int age; public void Input() { Console.Write("请输入猫的体重:"); this.weight = Convert.ToInt32(Console.ReadLine()); Console.WriteLine(); Console.Write("请输入猫的颜色:"); this.color = Console.ReadLine(); Console.WriteLine(); Console.Write("请输入猫的年龄:"); this.age = Convert.ToInt32(Console.ReadLine());
} public void Output() { Console.WriteLine("猫的体重为:",this.weight); Console.WriteLine("猫的颜色为:",this.color); Console.WriteLine("猫的年龄为:",this.age); } public void Modify() { Console.WriteLine("信息修改中..."); Console.Write("体重"); this.weight = Convert.ToInt32(Console.ReadLine()); Console.Write("颜色:"); this.color = Console.ReadLine(); Console.Write("年龄:"); this.age =Convert.ToInt32(Console.ReadLine()); } } } namespace 类的应用_猫_ { class Program { static void Main(string[] args) { Class1 a = new Class1(); a.Input(); a.Output(); a.Modify(); Console.ReadLine(); } } } 为什么不能运行呢?