日期:2014-05-17 浏览次数:20832 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Reftest
{
class Program
{
static ClassA mClassA;
static void Main(string[] args)
{
ClassA.FillData(1, mClassA);
foreach(int i in mClassA.numList)
{
Console.WriteLine(i);
}
Console.ReadLine();
}
}
public class ClassA
{
public static ClassA classa = null;
public List<int> numList = new List<int>();
public static ClassA InitClassA()
{
if (classa == null)
{
classa = new ClassA();
}
return classa;
}
public static void FillData(int a, ClassA wclassa)
{
wclassa = InitClassA();
classa.numList.Add(a);
}
}
}