private void populateEmployees() throws FileNotFoundException
{
File loc = new File(employeesPath);
Scanner read = new Scanner(loc).useDelimiter(",");
while (read.hasNext())
{
String firstName = read.next();
String lastName = read.next();
String age = read.next();
String gender = read.next();
String startDate = read.next();
String currentEmployee = read.next();
int totalHours = read.nextInt();
String hourlyPay = read.nextLine();
hourlyPay = hourlyPay.substring(1,hourlyPay.length() - 1);
Employee employee = new Employee(firstName, lastName, age, gender, startDate, currentEmployee, totalHours, Double.parseDouble(hourlyPay));
employees.add(employee);
}
read.close();
}
While I did find a solution I'm still confused as to why String hourlyPay is getting a comma added to the beginning of its string. Anyone care to offer some insight on this?