Computer Science Canada File Reader! |
Author: | Shivu [ Sat Jun 14, 2008 12:01 am ] | ||
Post subject: | File Reader! | ||
hi! i have a lot of trouble regarding filereader and bufferreader. naeming i don't know if the thing reads the line or character (i don't even know how it reads the line: as each character or as a line) as an int, a char, or string... There is a question i have to write code for regarding filereader and buffer reader... I'm very confused on this topic... oh along with the try and catch thing...that's what we've to write with filereader and bufferreader.. right? So if one could help me with this, that would be great : ![]() but first, the question, i really need help with this: In the text file ?data.txt?, the first line contains an integer which indicates the number of lines that follow. You program should read each one of these lines and then output on the screen the one with the longest length. my code:
My code is wrong because whenever i try to run it an exception comes up: nullpointerexception... so, i don't know how to rectify it.... and if you can explain the logic / concept, that'd be great (or explain what you are trying to say ![]() thank you! |