无法找到符号睡眠(int)& printen(INT)

时间:2016-12-25 13:31:39

标签: java scite

我想要与Sleep()和printen()相关的帮助

.card {
    background-color: #FFFFFF;

}
.w3-card-4 > .card

我有错误

  

无法找到符号

     

symbol:方法sleep(int)

     

location:class example

     

睡眠(1000);

请帮我解决这个问题

1 个答案:

答案 0 :(得分:0)

import java.util.*;
public class example
{
public static void main(String[]args)
{
    int i = 1;
    int a = 4;
    while( i < 4 )
        {
            i++;
            a--;
            try {
            // thread to sleep for 1000 milliseconds
           Thread.sleep(100);
           } catch (Exception e) {
           System.out.println(e);
           }
            System.out.println("\t\t\t\t The Game Begins In...");
            System.out.print("\t\t\t\t " + a);
        }

        }
   }

Output

The Game Begins In...
                 3               The Game Begins In...
                 2               The Game Begins In...
                 1