gpt4 book ai didi

java - JAVA中this(var)和this.var有什么区别

转载 作者:行者123 更新时间:2023-12-03 21:42:12 26 4
gpt4 key购买 nike

<分区>

JAVA中的this(var)和this.var有什么区别?

public class Clock {

private long time = 0;

private Clock(long time) {
this.time = time;
}

public Clock(long time, long timeOffset) {
this(time);
this.time += timeOffset;
}

public static Clock newClock() {
return new Clock(System.currentTimeMillis());
}
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com