in your last set of methods, word requires a boolean parameter x.
Also, when you had this:
public class NewClass {
String word(boolean x) { // i add some parameters here..
return "My Method";
}
public String word() { //method word is already defined
return word();
}
}
Here, word() will never return because it's always calling itself, not the other word. It should be this:
public class NewClass {
String word(boolean x) { // i add some parameters here..
return "My Method";
}
public String word() { //method word is already defined
return word(true); // or false, it doesn't matter in this case
}
}