class Time
{
// The data associated with the Time class
private int h,m,s;
// and the methods
public void displayH() // The method header
{
System.out.println("The hour is " + h);
// The method body
}
public void displayM() // The method header
{
System.out.println("The minute is " + m);
// The method body
}
public void displayS() // The method header
{
System.out.println("The second is " + s);
// The method body
}
public void setTime(int hour, int min, int sec)
//method header
// and method body |