/**
 * Demonstrates use of interface.
 * Since Car implements Powered, which extends Movable, Car must implement
 * the move method and the milesPerGallon method.
 */
public class Car implements Powered {
    
    private double mpg;
    private double xcoord;
    private double ycoord;
    
    protected int tankSize = 15; // in gallons
    
    public Car(double mpg) {
        this.mpg = mpg;
        xcoord = 0;
        ycoord = 0;
    }
    
    @Override
    public String toString() {
        return xcoord + ", " + ycoord;   
    }
    
    public double milesPerGallon() {
        return mpg;
    }
    
    public void move(double x, double y) {
        xcoord += x;
        ycoord += y;
    }
    
    public int getTankSize() {
        System.out.println("Car's getTankSize()");
        return tankSize;   
    }
    
    public static String staticMethod() {
        return "Car's static method";
    }
    
    public static void main(String args[]) {
        Car car = new Car(32);
        car.move(1, 1);
        System.out.println(car);
        
        System.out.println(SPEED_LIMIT);
        System.out.println(car.getTankSize());
        System.out.println(staticMethod());
    }
}

