For some reason class method getTime() won't output on the console screen the time. Where did I go wron开发者_开发百科g?
Your set methods have infinite loops!
private void setM(int minutes)
{
while (minutes > 59)
{
h++;
m = minutes - 60;
}
}
When will this method stop?
The while loops in couple functions never return. Try
private void setM(int minutes)
{
while (minutes > 59)
{
h++;
minutes-=60;
}
m = minutes;
}
and
private void setS(int seconds)
{
while (seconds > 59)
{
m++;
seconds-=60;
}
s = seconds;
}
精彩评论