vs2012運(yùn)行程序的結(jié)果顯示頁(yè)面閃一下就沒(méi)了,有輸出的
namespace?ConsoleApplication1
{
????class?Program????{
????????static?void?Main(string[]?args)
????????{
????????????Child?xiaoMing?=?new?Child();
????????????xiaoMing._name?=?"小明";
????????????xiaoMing._sex?=?"男";
????????????xiaoMing._age?=?6;
????????????xiaoMing._height?=?120;
????????????Console.WriteLine("我叫"?+?xiaoMing._name);
????????????xiaoMing.PlayBall();
????????}
????}
}
2017-02-16
有兩種方式可以看清楚輸出,不至于一閃而過(guò)。1、按ctrl+F5?調(diào)試,輸出結(jié)果的窗口會(huì)一直顯示。2、在代碼xiaoMing.PlayBall();下面一行加上Console.ReadLine();??這樣調(diào)試后會(huì)等待輸入,窗口也不會(huì)馬上消失。