What's missing is that you need to initialize the boolean variable alphabetical
here as you have not provided a else
in the conditions for your outermost if-else conditions. Although you have covered all the possible paths logically, you need to let the compiler know of the same too. The compiler is worried that there might be a code path in which alphabetical is never initialized as there is no else or default condition specified.
There are two ways to resolve your issue:
1> The alphabetical should be set to a default value(which will never be used)
2> replace the else if(length!=1)
with simply else