I'm learning java as a beginner so if this question is incredibly trivial, bear with me- we all started from somewhere!
I'm learning about the tostring method and apparently my code below is meant to print out "Hello" however what it is printing out is Ape@6D06d9c which I just dont understand. Could someone please help in explaining where exactly I am wrong and how to remedy it
class Ape {
public String tostring() {
return "Hello";
}
}
public class learningtostring1{
public static void main(String[] args){
Ape kermit = new Ape();
System.out.println(kermit);
}
}