Lab_3

Lab Description
In this lab we are learning how inheritance work, so in the we are creating many classes where the second class will inherit the first class and the third
class will inherit the first and second class and so on.
……………………………………………………………………………………………………….

package Lab3;
import java.lang.String;

public class Lab3
{
public static void main(String args[])
{
MobileDevice mobile = new MobileDevice();
SmartPhone smart = new SmartPhone();
Android paranoid = new Android();
iPhone ios = new iPhone();
WindowsPhone window = new WindowsPhone();

System.out.println(mobile.getDeviceType());
System.out.println(smart.getDeviceType());
System.out.println(paranoid.getDeviceType());
System.out.println(ios.getDeviceType());
System.out.println(window.getDeviceType());
}
}

……………………………………………………………………………………………………….
Lab3_1

Leave a Reply

Your email address will not be published. Required fields are marked *