How can I read from a file this line 19 34 Gateway Arch - St. Louis, MO. The first digit is age, second timeUsed, and the rest description. So I want to read them and store them in a variable. The code insime my while loop of my File is int age = reader.nextInt(); Int Tused = reader.nextInt(); Description = reader.next() | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can I read from a file this line 19 34 Gateway Arch - St. Louis, MO. The first digit is age, second timeUsed, and the rest description. So I want to read them and store them in a variable. The code insime my while loop of my File is int age = reader.nextInt(); Int Tused = reader.nextInt(); Description = reader.next()

22nd Apr 2017, 8:30 PM
Isaac
Isaac - avatar
4 Answers
+ 2
that looks right to me. i dont understand the problem
22nd Apr 2017, 8:32 PM
Edward
+ 1
ok so just do it all again, but with different variable names
22nd Apr 2017, 8:42 PM
Edward
0
@edward the problem is that in the file there is another line I have to read which has the same order 2 integers and then a Description.
22nd Apr 2017, 8:35 PM
Isaac
Isaac - avatar
0
@edward but I need to store them in an array
22nd Apr 2017, 9:04 PM
Isaac
Isaac - avatar