Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  Test
Language: JAVA
Code:
class Base{

}

class Derived extends Base{

}

public class Test{
  public void methodA(Base b){
    System.out.println("Test.methodA(Base)");
  }
  public void methodA(Derived b){
    System.out.println("Test.methodA(Derived)");
  }

  public static void main(String []args){
    Test t = new Test();
    Base b = new Base();
    Base d = new Derived();

    t.methodA(b);
    t.methodA(d);

  }
}
Comments: