class select
{
public static Object function(Object obj)
{
if(obj instanceof Fu)
{
Fu x = (Fu)obj;
return x;
}
else if(obj instanceof Zi)
{
Zi x = (Zi)obj;
return x;
}
else{
return -1;
}
}
}
class function
{
public static boolean equals(Object obj,Object obj1)
{
select.function(obj);
select.function(obj1);
return obj.num == obj1.num;
}
}
class ObjectDemo
{
public static void main(String args[])
{
Fu f1 = new Fu();
Zi f2 = new Zi();
f1.setNum(8);
f2.setNum(8);
System.out.println(function.equals(f1,f2));
}
}