ilham_syamsuddin

Untitled

Sep 19th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. public class Time1Test
  2. {
  3. public static void main( String[] args )
  4. {
  5. Time1 time= new Time1();
  6. System.out.print("The Initial universal time is: ");
  7. System.out.println(time.toUniversalString() );
  8. System.out.print("The Initial standard time is: ");
  9. System.out.println(time.toString() );
  10. System.out.println();
  11.  
  12. try
  13. {
  14. time.setTime( 99,99,99);
  15. }
  16. catch (IllegalArgumentException e)
  17. {
  18. System.out.printf( "Exception: %s\n\n", e.getMessage() );
  19.  
  20. }
  21.  
  22. System.out.println( "After attempting invalid values: " );
  23. System.out.print("Universal time: ");
  24. System.out.println(time.toUniversalString() );
  25. System.out.print("Standart Time: ");
  26. System.out.print(time.toString());
  27.  
  28.  
  29. }
  30. }
Add Comment
Please, Sign In to add comment