0% found this document useful (0 votes)
16 views

Lab Task 8 - 1

Uploaded by

Tahira Batool
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views

Lab Task 8 - 1

Uploaded by

Tahira Batool
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Lab Task 8

Task_1:
Bird
-Name : String
-Color:String

+Bird()
+Bird(String, String)
+toString():String

Fly
Duck -canFly : Boolean
-duckFly : Fly -Age : int

+Fly()
+Duck() +Fly(Boolean, int)
+Duck(String, String, Fly) +SetFly(Boolean): void
+SetFly(Fly): void +GetFly():Boolean
+GetFly():Fly +toString():String
+toString():String

Create a ‘Bird’ class as parent class. Duck class extends Bird class as shown in UML Diagram.
Create a Fly object which is created in Duck class.

Task_2:
- Create BirdDriver class with main method.
- Create Fly object.
- Create Duck object and pass Fly class as an argument in its constructor.
- Print details of the Duck from toString() method.

You might also like