Guest User

Untitled

a guest
Jun 24th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. package com.javarush.test.level09.lesson11.home02;
  2.  
  3. /* Countdown from 10 to 0
  4. Write a loop to countdown from 10 to 0. Use Thread.sleep(100) to make a delay;
  5. Wrap the sleep call into a try..catch.
  6. */
  7.  
  8. public class Solution
  9. {
  10. public static void main(String[] args)
  11. {
  12. for (int i = 10; i >= 0; i--)
  13. {
  14. System.out.println(i);
  15.  
  16. try
  17. {
  18. Thread.sleep(100);
  19. }catch (Exception exception){
  20. System.out.println(exception.toString() + " " + exception.getMessage());
  21. }
  22. }
  23. }
  24. }
Add Comment
Please, Sign In to add comment