Any how myMethod() should return a String value .what if your condition is false is myMethod return anything? ans is no so you need to define return null or some string value in false condition
public String myMethod() {
boolean c=true;
if (conditions) {
return "d";
}
return null;//or some other string value
}