public class Time
extends java.lang.Object
| Constructor and Description |
|---|
Time(int hours,
int minutes)
Instantiates a new time.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Time t)
Determines whether another
Time object is before or after this. |
boolean |
equals(Time t)
Tests whether two
Time objects represent the same time. |
java.lang.String |
toString()
Displays the time.
|
public Time(int hours,
int minutes)
hours - (0-23)minutes - (0-59)public boolean equals(Time t)
Time objects represent the same time.t - Object to be comparedTrue if both fields match, else falsepublic int compareTo(Time t)
Time object is before or after this.t - The other Time objectpublic java.lang.String toString()
toString in class java.lang.ObjectHH:MM (24hr)