Skip to content

Latest commit

 

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Steven - 2702398283 - L2AC

Screenshots

Animal class

Animal Class

Dog class

Dog class

Animal Driver

Animal Driver

Results

Result

Explanation for the oop used

1. Encapsulation

The attributes inside animal class are declared as private, encapsulating the internal state of the class. They could be controlled by setter and gester, providing a level of abstraction and protection for the internal data.

2. Abstraction

Animal class is declared as abstract class which means by extended by subclasses. Example of makesound() which provide their own implementation for making a sound.

3. Inheritance

In the Dog class it inherits the attributes and methods defined in 'Animal class' and also provide its own specific implementations.

4. Polymorphism

The speak() method in the AnimalClass is overridden in the Dog class. When an object of type Dog is used, the overridden speak() method in the Dog class is invoked

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages