lab4

The objective of this lab is to learn about inheritance in Java as well as the proper usage of abstract classes and methods. The program has to be able to follow the hierarchy below through the use of inheritance.
Code

package v2;

public class Android extends SmartPhone{

	private String deviceType;

	public Android(){
		deviceType="Android";	
		}

	public void setDeviceType(String value){
		deviceType=value;
	}

	@Override
	public String getDeviceType(){
		return super.getDeviceType()+"->"+deviceType;
	}
}
package v2;

public class iPhone extends SmartPhone{

	private String deviceType;

	public iPhone(){
		deviceType="iPhone";	
		}

	public void setDeviceType(String value){
		deviceType=value;
	}

	@Override
	public String getDeviceType(){
		return super.getDeviceType()+"->"+deviceType;
	}
}
package v2;

public class MobileDevice{

	public String deviceType;

	public MobileDevice(){
		deviceType="Mobile Device";	
		}

	public void setDeviceType(String value){
		deviceType=value;
	}

	public String getDeviceType(){
		return deviceType;
	}
}
package v2;

public class MobileDeviceClient{
	public static void main (String [] args){
		MobileDevice myMobileDevice= new MobileDevice();
		SmartPhone mySmartPhone=new SmartPhone();
		iPhone myiPhone=new iPhone();
		Android myAndroid=new Android();
		WindowsPhone myWindowsPhone= new WindowsPhone();
		myWindowsPhone.setDeviceType("WindowsPhone");
		System.out.println(myMobileDevice.getDeviceType());
		System.out.println(mySmartPhone.getDeviceType());
		System.out.println(myiPhone.getDeviceType());
		System.out.println(myAndroid.getDeviceType());
		System.out.println(myWindowsPhone.getDeviceType());
	}
}
package v2;

public class SmartPhone extends MobileDevice{

	private String deviceType;

	public SmartPhone(){
		deviceType="Smart Phone";	
		}

	public void setDeviceType(String value){
		deviceType=value;
	}

	@Override
	public String getDeviceType(){
		return super.getDeviceType()+"->"+deviceType;
	}
}

package v2;

public class WindowsPhone extends SmartPhone{

	private String deviceType;

	public WindowsPhone(){
		deviceType="WindowsPhone";	
		}

	public void setDeviceType(String value){
		deviceType=value;
	}

	@Override
	public String getDeviceType(){
		return super.getDeviceType()+"->"+deviceType;
	}
}

Screen sht