ERROR « StringTokenizer « Java Data Type Q&A

1. ERROR HANDLING for my String tokenizer

else if (sCarRental.equals("EP")) {
                sStationCode = st.nextToken().trim();

2. error when Trying to read State Names using string tokenizer

This program allows a user to calculate to enter sales and calculate sales taxes per state. The program is giving errors when it gets to reading the double word states (eg New ...

3. StringTokenizer errors

5. Error in StringTokenizer

As you are not defining any delimiter for tokenizer, by default it will take space as a delimiter. In the program you are expecting always 3 tokens in a line. Without checking any number of tokens in each line. May be in one of the line the space was missing between the tokens. Check the input file for the correctness.

6. Error with stringTokenizer