Student.cs<7,22> :errorCS0246:
找不到类型或命名空间名称“Person”(是否缺少 using 指令或程序集引用?)
using System;
using System.Collections;
using System.IO;
public class Student:Person {
...................    
     }
------------------------------------------
using System;
public abstract class Person
{
     private string name;
     private string ssn;
     public Person(string name, string ssn)
     {
         this.Name = name;
         this.Ssn = ssn;
     }
     public Person(): this("?", "???-??-????")
     {
     }
     public string Name
     {
         get
         {
             return name;
         }
         set
         {
             name = value;
         }
     }
     public string Ssn
     {
         get
         {
             return ssn;
         }
         set
         {
             ssn = value;
         }
     }
     public abstract override string ToString();
     public virtual void Display()
     {
         Console.WriteLine("Person Information:");
         Console.WriteLine("\tName"+this.Name);
         Console.WriteLine("\tSoc.Security No.:"+this.Ssn);
     }
}
上面是Student类(派生自Person)代码,下面是Person类代码。在sdkv2.0编译出现标题上面的提示,哪位大虾帮忙下啊~~~~
------解决方案--------------------命名空间都不一样啊?
派生只是相对于同样的namespaces
using Person;就可以了
------解决方案--------------------Person的命名空间是什么呢?
------解决方案--------------------都加一个命名空间的限定看看。
------解决方案--------------------你要先找出Person这个类在哪里定义的啊。
连你自己都不知道person在哪里定义的,电脑又怎么会知道