/*
 * This File is one of the examples from Java Object Oriented Programming
 * Do not reproduce this code for others or use it in a commercial setting without prior permission from the author.
 */

package products;

/**
 *
 * @author Matthew Gregory
 * @website www.matthewgregory-author.com.au
 *
 */
public class Ruler extends Product{
    private String length;
    
    //Constructor that accepts name, brand, colour, price, and length
    public Ruler(String name, String description, double price,String length) {
//        setName(name);
//        setPrice(price);
//        enterDescription(description);
        super(name,description,price);
        setLength(length);
    }   
    
    //This method will override the one in the Products class
    @Override
    public void printProduct(){
        //No need for this code as we can call the Products printProduct to do this...
        //Output.writeln("Name: "+getName());
        //Output.writeln("Description: "+getDescription());
        //Output.writeln("Price: "+getPrice);
        super.printProduct();
        System.out.println("Length: "+getLength());
    }

    public String getLength() {
        return length;
    }

    public void setLength(String length) {
        this.length = length;
    }
}
