求教啊!!!
class time
{
private int hour;
private int minute;
private int second;
public time()
{
hour = System.DateTime.Now.Hour;
minute = System.DateTime.Now.Minute;
second = System.DateTime.Now.Second; }
public time(int h, int m, int s)
{
hour = h;
second = s;
minute = m;
}
public void addsecond()
{
second++;
if (second >= 60)
{
second = second % 60;
minute++;
}
if (minute >= 60)
{
minute = minute % 60;
hour++;
}