Read the following code and can anybody explain how the code works
class Dumb{
Dumb(){
Object y = new X();
((X)y).m(y);
String in1 = y.toString();
}
public static void main(String[] args){
new Dumb();
}
}
class X {
public void m (Object x)
{
System.out.println("In m "+x);
}
public String toString()
{
System.out.println("ToSTring in Tostring");
return "123";
}
}