java怎么键盘输入数据啊?
java怎么键盘输入数据啊?
我用的是jbuilder9.0,它似乎不支持键盘直接为某个数据item赋值,而且在它下面怎么加入一个文件并且打开啊?我利用new file 建立一个txt文件,但是不能读出……汗……为什么这么麻烦?为什么就没有C++好用哦……
import java.io.*;
public class TestIN {
public static void main(String [] args){
BufferedReader buf;
int num;
String str;
buf=new BufferedReader(new FileReader("infile.txt"));
System.out.print("Input the integer:");
str=buf.readLine();
}
}
此程序包含下面异常:
"TestIN.java": unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown at line 9, column 30
"TestIN.java": unreported exception java.io.IOException; must be caught or declared to be thrown at line 11, column 15
希望大虾能帮一下,谢谢啊……


我的QQ409189793