I am on java 6. Using DataInputStream in = new DataInputStream(System.in);
to read user input. When the readLine() is deprecated. What is the work around for reading user value?
DataInputStream in = new DataInputStream(System.in);
int num;
try
{
num = Integer.parseInt(in.readLine()); //this works
num = Integer.parseInt(in); //just in doesnt work.
}
catch(Exception e)
{
}
please explain as it should when the readLine() is deprecated.