Original Post
Hi All!!
When I''m doing homework it seems that type conversions hang me up more than anything! Why can''t I just assign a String to an Int Dammit! Anyway... I''m reading in a .txt file of numbers seperated by \n charecters. My code looks like this:
This works fine execpt when I call parseInt I only go through the loop once!! If I comment out the parseInt and System.out.println(Temp); It goes through numLines times like it should! What gives? Is there a better way to convert these types!
Thanks!
String Temp;
Int IntTemp;
for (int i = 0; i < numLines; i++
{
Temp = inputFile.readLine();
IntTemp = java.lang.Integer.parseInt(Temp)
}