首页 > 解决方案 > System.out.flush 在 Apache Netbeans IDE 中不起作用?

问题描述

import java.util.Scanner;
public class TestClass{
    public static void main(String[] args) {
        System.out.print("input a string:  ");
        System.out.flush();
        Scanner s = new Scanner(System.in);
        s.next();
    }
}

在我输入字符串之前,字符串“输入字符串:”无法打印到输出窗口。

很困惑。

标签: java

解决方案


推荐阅读