package gee;


class A{

 void a(){

  System.out.println(1);

 }

}

class B{

 void a(){

  System.out.println(2);

 }

}

class C{

 void a(){

  System.out.println(3);

 }

}

class D{

 public static void test(Object o){

 

  if(o instanceof A)

   ((A)o).a();                    ------------->>> test 메서드를 쭐이야함

  else if(o instanceof B)

   ((B)o).a();

  else

   ((C)o).a();

 

 

 }


public static void main(String args[]){

  test(new A());

  test(new B());

  test(new C());

 }

}