在Main函數(shù)下使用類
Main就是主函數(shù)。
static void Main(string[] args)
{
? ? ? ? Customer c1 = new Customer();//運用類創(chuàng)建對象,成c1就是對象名
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?//所以對象也就是一個變量
? ? ? ??Customer c2;//聲明了一個對象,
? ? ? ? c2 = new Customer();//實例化一個對象
}
標簽:
在Main函數(shù)下使用類的評論 (共 條)
