Skip to content

Instantly share code, notes, and snippets.

@ProZhar
Created December 4, 2015 11:39
Show Gist options
  • Select an option

  • Save ProZhar/b6175836fb17da3c5e87 to your computer and use it in GitHub Desktop.

Select an option

Save ProZhar/b6175836fb17da3c5e87 to your computer and use it in GitHub Desktop.
com.javarush.test.level09.lesson11.home02
package com.javarush.test.level09.lesson11.home02;
/* Обратный отсчёт от 10 до 0
Написать в цикле обратный отсчёт от 10 до 0. Для задержки иcпользовать Thread.sleep(100);
Обернуть вызов sleep в try..catch.
*/
public class Solution
{
public static void main(String[] args)
{
for (int i = 10; i >= 0; i--)
{
System.out.println(i);
try
{
Thread.sleep(100);
}
catch (Exception e)
{
e.printStackTrace();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment