package com.example.interfaces;

public class TestInterface {

	public static void main(String[] args) {
		Bird b = new Bird("pink");
		System.out.println("Bird has " + b.getFeet() + " feet.");
		b.takeoff();
		b.flying();
		b.landing();
		System.out.println();

		Airplane a = new Airplane();
		System.out.println("Airplane has " + a.getWings() + " wings and " + a.getWheels() + " wheels.");
		a.takeoff();
		a.flying();
		a.landing();
		System.out.println();

		// polymorphism
		// cannot create object from interface
		// but can create object from classes that implements interface
		Fly f = new Bird("yellow");
		f.takeoff();
		f.flying();
		f.landing();
		System.out.println();

		// use the same variable but now assign Airplane object instead
		f = new Airplane();
		f.takeoff();
		f.flying();
		f.landing();
	}

}
