BufferedReader最重要,因为有个方法public String readLine()
package System输入输出; import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader; public class Test {
public static void main(String[] args) throws IOException {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.print("请输入数据:");
String str=br.readLine();
System.out.println(str);
}
}
不限制长度且无乱码输入