Java using BlueJ
Create a project Zoo in BlueJ. The project has Animal, Mammal, Reptile, Dog classes Animal is the super class of Mammal and Reptile. Dog is a subclass of both Mammal and Animal class a) Show the relationship between above mentioned classes and write the necessary class definitions (fields and methods). All the fields and methods should be declared .as protected b) Implement the concept of method overriding in the Zoo project. Use keyword super .to call the base constructor in each subclass
Create a project WildLife in BlueJ. The project has Mammal, Reptile, Crocodile, Rabbit and Fox classes. .Rabbit and Fox inherit from Mammal. Mammal and Reptile inherit from an abstract class Animal .a) Show the relationship between above mentioned classes and write the necessary class definitions b) Class Animal should have both abstract and non-abstract methods. The Animal class have may run(), eat(), die() as abstract methods. Reptile class does not provide implementation of Animal's abstract methods, thus has to be declared as abstract
Java using BlueJ
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am