using System;namespace CallConstructor{public class Car{int petalCount = 0;String s = "null";Car(int petals){petalCount = petals;Console.WriteLine("Constructor w/int arg only,petalCount = " + petalCount);}Car(String s, int petals): this(petals){this.s = s;Console.WriteLine("String & int args");}Car(): this("hi", 47){Console.WriteLine("default constructor");}public static void Main(){Car x = new Car();Console.Read();}}}能幫我解釋一下這段代碼中幾個this的意思嗎?
- 2 回答
- 0 關注
- 346 瀏覽
添加回答
舉報
0/150
提交
取消