This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Problem with parseInt and entering in array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problem with parseInt and entering in array" Watch "Problem with parseInt and entering in array" New topic
Author

Problem with parseInt and entering in array

Lio Liov
Ranch Hand

Joined: Mar 21, 2012
Posts: 33
I am trying to run this code and I have problem with adding integers in the ArrayList
Could you tell me why
The exception happens on the last line


Michal Plutynski
Greenhorn

Joined: Mar 01, 2012
Posts: 14

Could you give and example of file you are using (openFile.txt)?
Lio Liov
Ranch Hand

Joined: Mar 21, 2012
Posts: 33
This is the file:
ram size:111
expected time:1000
priority:3
Michal Plutynski
Greenhorn

Joined: Mar 01, 2012
Posts: 14

Do not 'eat' the exception. Maybe throw 'Exception e' to the console, then you will find out what is the problem or just post your exception here.
Lio Liov
Ranch Hand

Joined: Mar 21, 2012
Posts: 33
Thanks.My problem was that I didnt trim the string before I parse it
But enableing the exception help me figurate the problem
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem with parseInt and entering in array
 
Similar Threads
Help with ArrayList error
NullPointerException
File.exists() Problem
How to extract the value?
Giving runtime error