CreateChair Code

CreateChair.java

/*
 * Mark Hesser
 * HesserCAN 
 * [email protected]
 * www.hessercan.com
 */
 
package createchair;s
 
/**
 * @author mark
 */
public class CreateChair 
{
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) 
    {
 
    }
}

Chair.java

/*
 * Mark Hesser
 * HesserCAN 
 * [email protected]
 * www.hessercan.com
 */
 
package createchair;
 
/**
 * @author mark
 */
public abstract class Chair 
{
    private String color;
    private int legs;
 
    public Chair(String c, int l)
    {
        color = c;
        legs = l;
    }
 
    abstract void canRoll();
}

OfficeChair.java

/*
 * Mark Hesser
 * HesserCAN 
 * [email protected]
 * www.hessercan.com
 */
 
package createchair;
 
/**
 * @author mark
 */
public class OfficeChair extends Chair
{
    public OfficeChair(String c, int l)
    {
        super(c, l);
    }
 
    @Override
    void canRoll()
    {
        System.out.println("Can Roll");
    }
}

Bench.java

/*
 * Mark Hesser
 * HesserCAN 
 * [email protected]
 * www.hessercan.com
 */
 
package createchair;
 
/**
 * @author mark
 */
public class Bench extends Chair
{
    public Bench(String c, int l)
    {
        super(c, l);
    }
 
    @Override
    void canRoll()
    {
        System.out.println("Cannot Roll");
    }
}