read from text file into array of objects
Hi - can anyone share a simple example of how to read from a text file into an array of objects?
text file example:
Part ID: MOV001, Part No: PG, Description: Wheel
Part ID: MOV234, Party No: G, Description: Tyre
I wish to write this details into an array of part objects
Parts  part = new Parts ;
start of code:
BufferedReader bufr = new BufferedReader(new FileReader ("part.txt"));
Unsure how to go from here?
Re: read from text file into array of objects
If you already have your Parts class, you just need to read your data from the text file.
Here are some tutorials on how to do that:
Dystopian Code: Text File I/O in Java
Dystopian Code: Text File I/O with Strings that Contain Spaces in Java