As of the series make a return value?

Good day !
Write code for the game TIC/TAC toe at the moment trying to write a test win. The question arose.
There is a method performs ( in this case vertical) as I from this method to return the alternate value, provided that the cycle should not stop checking. When I write return in a loop, it interrupts its action, which is not suitable for my case, because then it does not check all verticals( and only first). I enclose a piece of code.
public String checkVertical (Field field){
 Point point1 = new Point(); //object creation figures
 Point point2 = new Point(); //object creation figures
 Point point3 = new Point(); //object creation figures
 String x = null; //variable which will return for a final check of the winner
 for (int i = 0; i < field.getSize(); i++){
 //check the coordinates
 point1.x = i; 
 point2.x = i;
 point3.x = i;
 point1.y = 0;
 point2.y = 1;
 point3.y = 2;
 x = checkThreePoint(point1, point2, point3, field) ; // this method checks the figures on the coincidence(if there is 3 of 3 the winner is returned, otherwise null
 if (x != null) {
 return x; //this check stops the loop that is incorrect
}
 else{ 
 return null;
}
}
 return x; // here should return the final winner
 }
April 19th 20 at 12:23
1 answer
April 19th 20 at 12:25
Remove the else { return null;}
then you will be out of the loop, at the first detection of the triplet, which is logical, what for to check on if three found. Or after completing all iterations of the loop.

As for the quality of code, null is not the same thing, which is usually vozvrat in java, it is logical to use a Boolean.
And variable names should work.

Find more questions by tags Java