/*
* TimeTest.java uses Time.java
*/
// Normally in the same directory, or have classpath to find Time class
public class TimeTest {
public static void main(String[] args)
{
// Time myTime(0,13,50);
C++ syntax illegal
Time myTime = new Time(0,13,50);
System.out.println(myTime); //
calls toString method
System.out.println(myTime.minute); // calls accessor
Time yourTime = new time(0,
13, 50);
// Try this with and without
have equals defined... what happens?
if (myTime.equals(yourTime))
System.out.println("We're on the same time");
else
System.out.println("We don't have the same time");
}
}