java构造方法调用问题
java新手,求大神看一下,小弟不明白public class Time
{
int hour, minute, second;
Time(){
}
public Time(long currentTime){
currentTime = System.currentTimeMillis();
}
Time(int hour, int minute, int second){
this.hour = hour;
this.minute = minute;
this.second = second;
}
void setTime(long elapseTime){
long currentTime = elapseTime;
}//这块怎么用?
public long getHour(){
long totalMilliseconds = System.currentTimeMillis();//如何调用上边Time(long currentTime)来实现这行代码
long currentHour = (((totalMilliseconds / 1000) / 60) / 60) % 24;
return currentHour;
}
public long getMinute(){
long totalMilliseconds = System.currentTimeMillis();//如何调用上边Time(long currentTime)
long currentMinute = ((totalMilliseconds / 1000) / 60) % 60;
return currentMinute;
}
public long getSecond(){
long totalMilliseconds = System.currentTimeMillis();//如何调用上边Time(long currentTime)
long currentSecond = (totalMilliseconds / 1000) % 60;
return currentSecond;
}
}