Skip to content

Advanced-Programming-1403/First-Workshop-Zoology

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

First Workshop - Zoology

A simple hierarchy to learn OOP concepts like Interfaces, Inheritance, Polymorphism, and Abstraction.

Overview

This project simulates a zoology system using Object-Oriented Programming (OOP) principles. It demonstrates how real-world entities (like animals) can be represented as classes, with shared characteristics and behaviors defined through interfaces, abstract classes, and inheritance.

Class Hierarchy

The project consists of the following classes and interfaces:

  1. Creature (Interface): The base interface representing any living creature.
  2. Mammal (Abstract Class): An abstract class implementing the Creature interface, representing mammals.
  3. Cat (Class): A subclass of Mammal that implements the Carnivore interface.
  4. Human (Class): A subclass of Mammal that implements both the Carnivore and Herbivore interfaces.
  5. Carnivore (Interface): Represents creatures that consume meat.
  6. Herbivore (Interface): Represents creatures that consume plants.

Class Diagram

+-------------------+
|     Creature      |
|   (Interface)     |
+-------------------+
        ^
        |
+-------------------+
|       Mammal      |
|  (Abstract Class) |
+-------------------+
        ^
        |
+-------------------+       +-------------------+
|        Cat        |       |       Human       |
|      (Class)      |       |      (Class)      |
+-------------------+       +-------------------+
| - implements      |       | - implements      |
|     Carnivore     |       |     Carnivore,    |
|                   |       |     Herbivore     |
+-------------------+       +-------------------+

What should you do?

Your task is to complete the implementation of the classes as described in the hierarchy.

How to get started

  1. Clone the repo in your local machine:
git clone <url>
  1. Open the project in Intellij IDEA or your IDE
  2. Complete the implementations
  3. Commit & Push your changes
git commit -m "message"
git push

Conclusion

This exercise is designed to help you understand key OOP concepts by modeling real-world entities. By completing this project, you'll gain a better understanding of interfaces, abstract classes, inheritance, and polymorphism.

Happy coding! 🚀

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages