You're missing a close curly bracket to end the outer
for
loop of
hasTwoA
:
public static boolean hasTwoA(String s)
{
boolean q = false;
for (int i = 0; i < s.length() && aCounter <= 2; ++i) {
^
missing matching bracket.
Do yourself a big favour and stick to one indentation system: when you copy'n'paste code from the internet and mix them up, it becomes really difficult to read and spot problems like this. Picking an indentation style and using it throughout makes problems like thsi so much more obvious ...