Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Defining a time type (class name Mytime) in Java as MyTime class should have three forms.
Defining a time type (class name Mytime) in Java as MyTime class should have three forms.
Parcel? Demonstration;

Public? Class? My time? {

Private? int? Hours? Minutes? Second;

Public? MyTime(int? Hours? int? Minutes? int? Second)? {

super();

This hour? =? Hours;

This minute? =? Minutes;

This, the second one? =? Second;

}

Public? Invalid? addSecond(int? Seconds)? {

Second? +=? sec

}

Public? Invalid? addMinute(int? min)? {

Minutes? +=? min

}

Public? Invalid? addHour(int? Hou)? {

An hour? +=? Hou;

}

Public? Invalid? Sub-second (int? Seconds)? {

Second? -=? sec

}

Public? Invalid? subMinute(int? min)? {

Minutes? -=? min

}

Public? Invalid? subHour(int? Hou)? {

An hour? -=? Hou;

}

Public? Invalid? diaplay()? {

System.out.println (hours? +? "When"? +? Minutes? +? "points" +? Second? +? "seconds");

}

}