using System; public interface IPerson { string getName(); } public class Taro : IPerson { public string getName() { return "クラスTaro"; } } public class Class1 { public static int Main(string[] args) { // 次の行はコンパイルエラーになる。 // Person person = new Person();//抽象クラスのインスタンスは作成できない Taro taro = new Taro(); Console.WriteLine( taro.getName() ); IPerson someone = new Taro(); Console.WriteLine( someone.getName() ); return 0; } }