package apples;
public class Fatty {
b banana = new b();
public void digest (b x) {
x.eat();
}
}
package apples;
abstract public class b {
public abstract void eat();
}
package apples;
class cup extends b {
public void eat() {
System.out.println("this cup is great");
}
}
package apples;
public class apples extends b {
public void eat() {
System.out.println("these apples are great");
}
}
Comments
Post a Comment