interface fruit
{
public abstract void eat();
}
class Apple implements fruit
{
public void eat()
{
System.out.println("吃苹果");
}
}
class Orange implements fruit
{
public void eat()
{
System.out.println("吃橘子");
}
}
class
public class Demo1
{
public static void main(String args[])
{
fruit f=new Apple();
f.eat();
}
}
模式