Question: 2. Write JAVA classes and interface as per class diagram and description given below: Animal Class a. b. C. a. b. C. < >

2. Write JAVA classes and interface as per class diagram and description given below: Animal Class a. b. C.

2. Write JAVA classes and interface as per class diagram and description given below: Animal Class a. b. C. a. b. C. < > Oviparous +layEggs(): boolean a. Duck +beakColor: String = '"yellow" +swim() +quack() Duck Class Create Duck class and instance variable which inherits the features of Animal class Define the swim () and quack() methods of Duck class. Oviparous interface Animal Define the layEgg() method as well +age: Int +gender: String Create Animal class and instance variables as per the class diagram Define the constructor of Animal Class to initialize the instance variables as per the class diagram Define the is Mammal() method of Animal Class +isMammal (): boolean +Animal(age:int.gender:String) Create Oviparous interface with the method mentioned in the UML Diagram. [02 Marks] [02 Marks] [02 Marks] [02 Marks] [02 Marks] [02 Marks] [03 Marks]

Step by Step Solution

3.42 Rating (168 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!