我的代码示例:
System.out.println("Why hello there!");
System.out.println("Welcome to 'Ancient Battles and Adventures!");
***DELAY WOULD GO HERE***
System.out.println("Now, what is your name?");
答案 0 :(得分:3)
public class MyClass {
public static void main(String[] args) {
System.out.println("Why hello there!");
System.out.println("Welcome to 'Ancient Battles and Adventures!");
try {
Thread.sleep(x);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("Now, what is your name?");
}
}
答案 1 :(得分:0)
您可以尝试此代码以获得成功
class ex
{
public static void main(String args[])
{
System.out.println("Why hello there!");
System.out.println("Welcome to 'Ancient Battles and Adventures!");
try
{
Thread.sleep(1000);// here you can delay for one second
}
catch(Exception e) {
e.printStackTrace();
}
System.out.println("Now, what is your name?");
}
}