Isn't that what I was trying to do?
Input is defined as a String and scanner sc.next(); returns a string. However in this case if I input '-10 10' it stops reading after '-10'. If someone can tell me where the problem was I'd really appreciate it.
On a side note I was able to fix the problem by not using a scanner, but using a buffered reader and input stream reader instead. Here's how:
Code:
BufferedReader bufferedreader = new BufferedReader(newInputStreamReader(System.in));
String number = bufferedreader.readLine();