两个项目:
第一个:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Ch10After4
{
public class MyCopyableClass
{
protected int myInt;
public int ContainedInt
{
get
{
return myInt;
}
set
{
myInt = value;
}
}
public MyCopyableClass GetCopy()
{
return (MyCopyableClass)MemberwiseClone();
}
}
}
第二个:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ch10After4;
namespace Ch10After4Clinent
{
class Program
{
static void Main(string[] args)
{
MyCopyableClass obj1 = new MyCopyableClass();
obj1.ContainedInt = 5;
MyCopyableClass obj2 = obj1.GetCopy();
obj1.ContainedInt = 9;
Console.WriteLine(obj2.ContainedInt);
}
}
}
运行后提示:\Ch10After4\obj\x86\Debug\Ch10After4.exe”不包含适合于入口点的静态“Main”方法
请问是怎么回事?
慕容森
BIG阳
相关分类