I have a txt file with integers in it like so 12312 341324 5

I have a .txt file with integers in it like so:

12312 341324 51245 345

4125 4325 23465 2356 ...

how can i read these into JAVA and put them in a sorted array?

Solution

Answer:

Generally, I would first read the whole file and save the entire text into one string, then close the file. Then I will call indexOf and substring functions to separate each number and save it into an array.

I have a .txt file with integers in it like so: 12312 341324 51245 345 4125 4325 23465 2356 ... how can i read these into JAVA and put them in a sorted array?So

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site