public interface Person
{
public void walk();
public void eat();
}
abstract class Employee implements Person
{
}
class EmployeeImpl extends Employee
{
@Override
public void walk()
{
System.out.println("walking");
}
@Override
public void eat()
{
System.out.println("eating");
}
}
AbstractClassTest.java public class AbstractClassTest
{
public static void main(String[] args)
{
Person personRef = new EmployeeImpl();
personRef.eat();
personRef.walk();
System.out.println("-------------------------");
Employee employeeRef = new EmployeeImpl();
employeeRef.eat();
employeeRef.walk();
}
}