package exerciseThree;

public class Time5 {
	private int hh,mm,ss;
    public Time5(){
    	hh=0;
    	mm=0;
    	ss=0;
    }
    
    public Time5(int h,int m,int s){
    	hh=h;
    	mm=m;
    	ss=s;
    }
    
    public int getHour(){
    	return hh;
    }
    public int getMinute(){
    	return mm;
    }
    public int getSecond(){
    	return ss;
    }
    
    public void setHour(int h){
    	hh=h;
    }
    public void setMinute(int m){
    	mm=m;
    }
    public void setSecond(int s){
    	ss=s;
    }
    
    public String toString(){
    	return hh+":"+mm+":"+ss;
    }
    
    public void increaseSecond(){
    	int sj=(ss+1)/60;    //秒级是否进位
    	int sy=(ss+1)%60;    //秒级
    	setSecond(sy);
    	
    	int mj=(mm+sj)/60;    //分级是否进位
    	int my=(mm+sj)%60;    //分级
    	setMinute(my);
    	
    	int hy=(hh+mj)%24;    //时级
    	setHour(hy);
    }
}
