|
Post by PiNkY_pIgLeT on Feb 2, 2002 16:11:18 GMT -5
It seems everything works properly but at the end of the output, I got a nullPointerException error... What's a nullPointerException? How can I solve this problem? Please help...
|
|
|
Post by Sylph on Feb 2, 2002 16:17:45 GMT -5
well, if u read to the end of a file, the last line read in is null.
|
|
|
Post by PiNkY_pIgLeT on Feb 2, 2002 16:30:34 GMT -5
then, is that what we suppose to have at the end of the output screen?? or we have to do something with it?
|
|
|
Post by Random_Death on Feb 2, 2002 18:57:44 GMT -5
nullPointerException occurs when you attempt to perform an operation on a null object. For instance line.indexOf("Hello"); where line is a String and null. ("" is not null. It's just the empty string)
I suspect that soemthing like that is happening in your code. Perhaps, when your code gets to the end of the file and reads null you attempt to do soemthing to it like you would do if it wasn't null. If statements would seem to be a fix.
|
|
|
Post by PiNkY_pIgLeT on Feb 2, 2002 19:25:57 GMT -5
o...thanks so much, i've fixed it!!!
|
|
|
Post by Random_Death on Feb 3, 2002 21:47:57 GMT -5
thatz cool.
|
|
|
Post by R on Feb 5, 2002 14:48:04 GMT -5
I am lazy.
Can I just throw it? ;D
how did u fix this?
|
|