I'm trying to write a program to perform some of the some of the functionality of StringTokenizer for an assignment, my instructor provides the driver and I do the rest. I've gone about as far as I can but I keep hitting a "NumberFormatException: null" run time error when trying to run the driver. I did some digging around and it looks like it's a result of my trying to parse a null value, but I've been banging my head on my desk trying to figure out how to fix it. Here's my code:
Driver (provided):
Here's my program (original):
Here's the text file it's reading:
1111,f,Anna,Arcello,10,1.01,1040,Suspension
2222,f,Barbara,Brew,20,2.02,1041
3333,f,Cindy,Crawford,30,3.03,1042
4444,f,Debbie,Desoni,40,1.40,1043,Probation
5555,m,Ed,Evans,50,2.50,1045
6666,f,Fonda,Farley,60,3.60,1040
7777,m,George,Goodin,70,1.07,1041,Probation
8888,f,Hedi,Hust,80,2.08,1042
9999,m,Ivan,Ingraham,90,3.09,1044
Here's the error I'm getting:
---------- Capture Output ----------
> "F:\Program Files\Java\jdk1.6.0_07\bin\java.exe" Meo04tokenizerDvr
Rec Tok Ct ID Name Hrs GPA Major Gender Status
--- ------ ---- ----------------- --- ---- ----- ------ ----------
1 8 1111 Arcello, Anna 10 1.01 1040 Female Suspension
Exception in thread "main" java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:415)
at java.lang.Integer.parseInt(Integer.java:497)
at Meo04tokenizer.getIntTok(Meo04tokenizer.java:45)
at Meo04tokenizerDvr.main(Meo04tokenizerDvr.java:46)
> Terminated with exit code 1.
I'd really appreciate any help you guys can give me.