No bro…
BufferedReader does the same work(a little bit faster) as Scanner
You could take space seperated integers as -
SCANNER
- read a full line
String s = sc.nextLine();
- Convert it to String array, by String.split() method
String[] inps = s.split(" ");
/* " " is for whitespace, use any other symbol as present in input */
- Now to convert a String to int pass it through Integer.parseInt()
int n=Integer.parseInt( inps[0] ); //this will convert the first string
BUFFERED READER
- Change the first step to
String s = br.readLine();
rest all things same