private void Form1_Load(object sender, EventArgs e)
{
List<boy> b1 = new List<boy>();
boy.instance=new boy();
boy.instance = new boy();
}
}
class boy
{
private string _name;
private int _age;
public static int x=10;
static bool flg = false;
public string name
{
get { return _name; }
set { _name = value; }
}
private static boy _instance = null;
public static boy instance
{
get { return _instance; }
set {if (flg == false)
{
_instance = new boy();
flg = true;
}
}
}