[hotjoe.com] HotJoe Java Help Forums
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Visit java.com
Please send email if you are having login problems - see the posts below for more info.
Hotmail and Yahoo! users - please see the Hotmail post or the Yahoo! post for information on lost emails.
My code compiles, but...  XML
Forum Index » Java Programming
Author Message
leapfrog7

Newbie

Joined: 02/11/2010 23:30:17
Messages: 13
Offline

I get the error below when I run my code:

Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:840)
at java.util.Scanner.next(Scanner.java:1461)
at java.util.Scanner.nextInt(Scanner.java:2091)
at java.util.Scanner.nextInt(Scanner.java:2050)
at InventoryProgram.main(InventoryProgram.java:33)

I can see where the problem is, but I cannot figure it out. Any and all help is greatly appreciated. Here is the section of code where the problem seems to be. I have more code for the program, but I would rather not put it in public view. However, if you feel you need to see it let me know. The following code is also the main class.





myInput.txt file:

Green AP
Bercana Tech
1
5
4.99
Red AP
Rodante Corp
2
10
6.83
Blue AP
Bercana Tech
3
7
0.89
Orange AP
Rodante Corp
4
3
7.27


Again, any help is greatly appreciated and I welcome all suggestions.

This message was edited 1 time. Last update was at 03/06/2010 18:18:42

leapfrog7

Newbie

Joined: 02/11/2010 23:30:17
Messages: 13
Offline

Nevermind, I figure out what the problem was.
 
Forum Index » Java Programming
Go to:   
Powered by JForum 2.1.9 © JForum Team
This site run by Scott Dunbar of Xigole Systems. © 2005-2011 - Scott Dunbar
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective owners
hotjoe.com, xigole.com, and Scott Dunbar have no affiliation with Oracle