+ 1

Need help. on this java code. I did the code but i am getting errors. Also coded. this in itellij

I put the code in sololearn but it was originally in IntelliJ and in separate classes. here are the instructions for more context: lastName id For a Person object: firstName lastName We recommend using the String method .split() which returns an array of strings, to parse the line. Your method should loop through every line in the file, and add a new Person or Student object to the people ArrayList by calling the appropriate constructor with the appropriate arguments.

9th Nov 2021, 7:48 AM
Carlye
Carlye  - avatar
5 Respuestas
+ 4
You use initializeListFromFile(filename) In SL Playground you cannot this do in this way. First you have to write the files here.
9th Nov 2021, 8:15 AM
JaScript
JaScript - avatar
+ 1
https://code.sololearn.com/c48ZPL2IQyaD here is the code I have now in Sololearn coding playground. But It is in separate classes and tried to label. it to show. ORIGINALLY in IntelliJ. THANKS for the HELP.
9th Nov 2021, 7:50 AM
Carlye
Carlye  - avatar
+ 1
I think these are the problems that are in your code. students.add(new Student(list[0], list[1], Integer.parseInt(list[2]))); public String toString(){ return "Student: " + this.firstName + " " + this.lastName + " " + this.id; }
9th Nov 2021, 8:14 AM
SoloProg
SoloProg - avatar
0
Ok, how do I fix these? Especially since it looks different on IntelliJ.
9th Nov 2021, 4:24 PM
Carlye
Carlye  - avatar
0
parseInt() write it lowerCase p - public String toString(){ return "Student: " +firstName +" "+ lastName +" "+ id; }
11th Nov 2021, 9:52 PM
zemiak