java - 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();
}
}
在我输入字符串之前,字符串“输入字符串:”无法打印到输出窗口。
很困惑。
解决方案
推荐阅读
- selenium-chromedriver - 如何在 beforeSession webdriverIO+Cucumber 中从 chromeOptions 设置参数
- android - 为什么 Kendo Dropdownlist 不适用于 chrome for android?
- c# - DataGrid DateTime IValueConverter,仅编辑时间,保留日期
- python - python中的多个循环
- php - 什么是在 PHP7 中使用匿名类的好例子
- mysql - 如果不满足条件,我如何在选定范围内包含上一行
- javascript - Vue搜索过滤器复选框问题
- javascript - 将数据 (d3) 投影到传单地图上的问题
- javascript - 如何获得类型化反应组件属性的代码完成?
- linux - apache linux中的ldap身份验证