我的代码示例:
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?");
最佳答案
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?");
}
}
关于java - 如何延迟程序以便在文本之间有停顿?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31738259/