Original Post
I have a text file with a bunch of numbers (most are doubles), likely, I know the first line says the number of objects p and then a lot of numbers for every p (from i=1 to p). Well this doesnt matter , my question is, whats the most recommended class I should use in order to read Integers or Doubles, something like reader.readInt() or like that. So far Ive been using a buffered reader, then I use readLine() and split() to cut the read string into small ones that contain each number, suppose the first line in the file reads : _15_40_ (where _ = whitespace) then I do String s=reader.readLine(); s.trim(); //eat the whitespaces String []new=s.split(" "); (and then new would be an array of 2 strings "15" and "40") and something like that for the rest of the file, I was just wondering if theres a more optimized way to do this with a class that implements reading Integers or Doubles (and is aware of whitespaces) or I should just continue the way Im doing it thx