Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Time2Test
- {
- public static void main(String [] args)
- {
- Time2 t1 = new Time2(); //00:00:00
- Time2 t2 = new Time2(2); //02:00:00
- Time2 t3 = new Time2(21,34); //21:34:00
- Time2 t4 = new Time2(12,25,42); //12:25:42
- Time2 t5 = new Time2(t4); //12:25:42
- System.out.println("Construted with : ");
- System.out.printf("t1: all arguments defaulted\n");
- System.out.printf(" %s\n",t1.toUniversalString());
- System.out.printf(" %s\n",t1.toString());
- System.out.printf("t2: hour specified; minute and second defaulted\n");
- System.out.printf(" %s\n",t2.toUniversalString());
- System.out.printf(" %s\n",t2.toString());
- System.out.printf("t3: hour and minute specified\n");
- System.out.printf(" %s\n",t3.toUniversalString());
- System.out.printf(" %s\n",t3.toString());
- System.out.printf("t4: hour, minute and second specified; minute and second defaulted\n");
- System.out.printf(" %s\n",t4.toUniversalString());
- System.out.printf(" %s\n",t4.toString());
- System.out.printf("t5: Time2 object t4 specified; minute and second defaulted\n");
- System.out.printf(" %s\n",t5.toUniversalString());
- System.out.printf(" %s\n",t5.toString());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement