Curmudgeon, you are an awesome person. I wish I could thank you more than I already have. I just rewrote the file that my teacher gave us and saved it as the same thing, and now the program works...
Type: Posts; User: bankston13
Curmudgeon, you are an awesome person. I wish I could thank you more than I already have. I just rewrote the file that my teacher gave us and saved it as the same thing, and now the program works...
So I commented out the String Tokenizer and tried the split option, but now it gives me an entirely new error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at...
Alright, so it seems that its counting the empty line at the end of the file as a line and trying to read it. Below is the contents of the .txt file:
Douglas~Waldron~49000.00~City Hall, 9027...
Sorry about that. I changed my code to your suggestion but it didn't solve the problem. I'll repost with the comment where the problem is.
import java.util.*;
import java.io.*;
public class...
My code is a payroll program that keeps track of an employee's first and last names, salary, and address. Whenever I try to run the program, I get the following error message:
Exception in thread...