1 public class Base{ 2 public void fooBar(){System.out.println("Base Ahoy!");} 3 } 4 5 public class Derived extends Base{ 6 public void fooBar(){System.out.println("Derived Ahoy!");} 7 8 public static void main(String args[]){ 9 Base b = new Derived(); 10 b.fooBar(); //Get this should pint Base Ahoy! 11 } 12 }