公共ApplePushService(IPushChannelFactory pushChannelFactory,ApplePushChannel设置channelSettings) :this(pushChannelFactory,channelSettings,默认值(IPushServiceSettings))
-
@尽管它是相关的,但就意图而言,这并不是这个问题的重复。 – 纳瓦尔 评论 2013年5月31日16:41 -
另请参见 stackoverflow.com/questions/3797528/… – 纳瓦尔 评论 2013年5月31日16:51
3个答案
//设置arg2的默认值,而无需调用该构造函数 公共类A(int arg1):this(arg1,1) { } 公共类A(int arg1,int arg2) { }
公共Foo(int x) { //此处可能使用x }
公共Foo(int x):base() { //此处可能使用x }
公共类已损坏 { public Broken():this(“哎哟”) { } public Broken(字符串错误):this() { } }
public ClassName():this(“abc”){} public ClassName(字符串名){}
这和那些参数的默认值一样吗?
调用其他构造函数。 将当前对象作为参数传递。 引用实例方法或字段。