Re: java problem: problem in returning a variable

‏2012-11-10T02:40:37Z

This is the accepted answer.
This is the accepted answer.

Firstly,your error is because of the initial problem, because you do not initial the reference points at the point you declare it,and put it in the try-catch statement,Point g = new Point(x,y);pointscounter = g; statements won't be executed,if there is some Exception occured before it.This will result in the situation that using a reference be initial it, to which is not allows.Solution:you could just change "Point points = null;".
Secondly,I think your program make a strict limitation on your format of you input file.If it is not for a special use, I think it may make your code weak!