When i run the program, i keep getting the following error:
I read data from a file and add it to a LinkedList but I keep getting this error when I run the program. It also skips every other line from the file which is annoying. Every other line gets added as an "Worker" object to the list fine but I don't know how to get over this problem, any ideas? Here is the code:
BufferedReader sbr = new BufferedReader(new FileReader("src/stafflist.csv"));
LinkedList<Worker> workerList = new LinkedList<Worker>();
while (sbr.readLine()!=null){
String[] lines = sbr.readLine().split(",");
Worker worker = new `enter code here`Worker(lines[0],Integer.parseInt(lines[1]),null);
workerList.add(worker);
System.out.println(worker.toString());
}