have a text file named students.txt that has data like the below 412 18 male drumming 446
Question:
have a text file named students.txt that has data like the below
412 18 male drumming
446 23 female running
... (keeps on going with this structure 1.student number 2.age 3.gender 4. hobby)
How could I save this into an array (I know how to (do this) in arraylist but I want to know how to save each row into an array)
2nd question is if I (create this) array in a class named studentMain (which would be the main method) and wanted to use this array to update the instance variable values in another class named update, like private int studentNumber or private String gender which are originally set to 0 and "", how would I update that? (I thought I could do something like update info = new update(); and info.setStudentNumber()
Java How To Program Late Objects Version
ISBN: 9780136123712
8th Edition
Authors: Paul Deitel, Deitel & Associates