以前java的System.in.readLine()现在怎么没了?
如题,记得以前一直用的啊,怎么现在没了啊???
import java.io.*;
public class ReadLine
{
public static void main(String[] args)
{
System.out.println("按Q/q键退出!");
String strLine="";
while(!strLine.equalsIgnoreCase("q"))
{
strLine = readString();
System.out.println(strLine);
}
}
public static String readString()
{
try
{
return new BufferedReader(new InputStreamReader(System.in)).readLine();
}
catch(Exception e)
{
e.printStackTrace();
return "";
}
finally
{
}
}
}