Hello,
I am working on an assignment and have run into a small problem. I have a method that returns a boolean value. My problem is that scope issues won't let me access the initialized value. Below is my method:
the error that comes up if i put the return statement inside the IF block is that it is out of reach...but leaving it like this and I get the error that it has not been initialized...
Help Please!
I am working on an assignment and have run into a small problem. I have a method that returns a boolean value. My problem is that scope issues won't let me access the initialized value. Below is my method:
Code:
public static boolean compare(int st1, int st2, int fin1, int fin2)
{
boolean overlaps;
if( ((st1 < st2)&&(st2 < fin1)) || ((st1 < fin2)&&(fin2 < fin1)) )
overlaps = true;
return overlaps;
}
Help Please!
Comment