0
How to read txt file in java
I am compiling my code in solo.learn app in my Android phone It's throwing file not found errors
2 Antworten
0
I don't think SoloLearn supports file reading. But you can start by sharing your code.
0
Can't read a file in sololearn, but you can get around it by putting a string of the data in the scanner to simulate reading a file.
Here's an easy example:
https://code.sololearn.com/c5Td5Lrco5s3/?ref=app
And here's an actual application of this; this is a homework assignment where I actually had to read in a .dat file. Lines 247 to 287 is the actual code commented out and the simulation code. (ported it to here to ask a question)
https://code.sololearn.com/cb813Qlfu8XV/?ref=app
If the file is too big you'll have to separate the strings into different varables since they have a character limit and change strings in the scanner object through loops and conditionals.