interface My
{
void show();
}
class Child implements My
{
public void show()
{
System.out.println("hello from show");
}
public String toString()
{
System.out.println("Hello from toString");
return "hello";
}
public static void main(String s[])
{
My m = new Child();
m.show();
m.toString();
}
}
**In the above code m is the reference variable of My interface, and toString() method is of Object class, which has been overridden by Child class, but how come reference variable of My type can call the toString() method (prototype of toString is not present in My interfaces), if i'll try to call other personnel methods of Child class using m then it would give compilation error, but it is not happening in this case. Why so? **