using System;
namespace ch10cardlib
{
public enum Suit//用沭举牌的花色
{
Club,
Diamond,
Heart,
Spade
}
public enum Rank
{
Ace = 1 ,
Deuce ,
Three ,
Four ,
Five ,
Six ,
Seven ,
Eight ,
Nine ,
Ten ,
Jack ,
Queen ,
King
}
/// <summary>
/// Class1 的摘要说明。
/// </summary>
public class Card
{
public readonly Suit suit() ;
public readonly Rank rank() ;
public override string ToString()
{
return "The" + rank + "of" + suit + "s" ;
}
private Card ()
{
}
public Card (Suit newSuit , Rank newRank) //创建Card实例。
{
suit = newSuit ;
rank = newRank ;
}
}
}
上面代码什么意思啊.为什么用new这个关键字啊。是不是调用构照函数的意思啊。.
public Card (Suit newsuit , Rank newrank)
{
}
高手先谢谢了!