SOLVED
The error I get is: testings.java:28: ';' expected
System.out.print(occurs('a',"hello"))
The code:
public class testings {
public static boolean occurs(char c, String s) {
boolean to_return = false;
while(true) {
if(s.equals("")) return to_return;
// s is not the empty string
char c2 = s.charAt(0);
System.out.print("c2 is "+c2);
System.out.print("c is "+c);
if(c==c2) { to_return = true; }
s=s.substring(1);
return to_return;
}
}
public static void main(String[] args) {
System.out.print(occurs('a',"hello"))
}
}