Finally solution found using the split() method of the String class (in addition to the Scanner class) as follows:
public static LinkedList<GymMembers> readFile() throws FileNotFoundException...
Type: Posts; User: billias
Finally solution found using the split() method of the String class (in addition to the Scanner class) as follows:
public static LinkedList<GymMembers> readFile() throws FileNotFoundException...
This is what I get when lName and fName is printed:
lName=Smith
fName=Smith
lName=62
Mary
fName=62
Mary
lName=1.65
fName=1.65
Thank you norm for your help
I have done what you suggested and I receive the following:
Joan Smith
1.68 62
Mary
Williams 1.65
78
Martin Jones
1.83 62
I am trying to read from a file the following data:
Joan Smith 1.68 62
Mary Williams 1.65 78
Martin Jones 1.83 62
Henry Davies 1.92 145
Nigel Brown 1.75 50
So I wrote the following code: