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 回答
- 2 回答
- 0 关注
- 325 浏览
添加回答
举报
0/150
提交
取消