在練習java的scanner時,editplus如何讀取從鍵盤輸入的數呢?
例如如下程序,編譯通過,運行時卻輸入不了數據:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
package myp101; import java.util.scanner; public class testshu{ public static void main(string[] args) { scanner shu = new scanner(system.in); system.out.println( "請輸入數字:" ); int num = shu.nextint(); system.out.println(num); system.out.println( "hello world!" ); } } |
這段程序是沒有問題的,問題出在editplus上。在編譯通過后,運行程序,在出現如下的輸入提示后,
要在控制臺點右鍵,選擇彈出菜單中的鍵盤輸入(keyboard input…)這一項,此時,會彈出一個窗體。
彈出的窗體如下:
輸入數據后,點擊ok即可正常運行:
到此這篇關于editplus運行java時從鍵盤輸入數據的操作方法的文章就介紹到這了,更多相關editplus運行java輸入數據內容請搜索服務器之家以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持服務器之家!
原文鏈接:https://blog.csdn.net/m0_46278037/article/details/114370591