please help me to sort out the issues.because my answer getting different from Kathie siera book answer.for the below code i get compile error because of redeclaration to sifter(BB . But in the book answer is "-434"
class AA{}
class BB extends AA{
}
public class ComingThru {
static String s="-";
public static void main(String args[])
{
AA aa []=new AA[2];
BB bb []=new BB[2];
sifter(aa);
System.out.println(s);
sifter(bb);
sifter(7);
System.out.println(s);
}
static void sifter(AA... a2)
{
s+="1";
}
static void sifter(BB... a2)
{
s+="2";
}
static void sifter(BB[] a3)
{
s+="2";
}
static void sifter(Object o){
s+="4";
}
}