Lab 1
Lab 1
Date: 08 / 09/2020
Lab1: Java P
1. Objectives
In this lab, students review Java language by doing the following tasks:
Task1 :
1- Create class called LabOne with attribute x=1
2- Create object of the class LabOne called object1 and print the value of attribute x
5- Use object1 to change the value of attribute x x=3. Using setter method.
Task 2
13- Create an abstract class called Vehicle which attributes V_ID and V_name. The class has method
called getName and another abstract method called getID.
14- Create subclass of the Vehicle called Car with attribute C_Year (i.e. creation year) and give the
get_ID method a body.
15- In the main method Create an object of the Car with a reference of type Vehicle then call
get_name and get_ID.
Data Structures and Algorithms / CS211 Lab Manu
Date: 08 / 09/2020