java 多态接口的实现

//接口的定义
interface eat
{
	void hand();
	void mouth();
}

class Animal implements eat
{
	private String name;
	private String sex;
	private int age;
	
	public Animal() {
		// TODO Auto-generated constructor stub
	}
	
	public void move()
	{
		System.out.println("animal move");
	}
	
	//继承接口要把接口内的函数都实现
	public void hand()
	{}
	
	public void mouth()
	{}
}
 

你可能感兴趣的:(JAVA)