/volume_calculator

A volume calculator for practice how to use interface, abstract class, Scanner, and StringBuilder

Primary LanguageJava

Use interface and abstract.

This quick repo is about learning Abstraction in Java at school and how to apply interfaces and abstract classes. Quick fun project to apply the knowledge and understand one of the four pillars of Object Oriented Programming.

Origin

This repo came from the school work of calculating the volume of a cone, but why stop there? Might as well do the JUnit test!

Different Shapes

Abstract class

We have an abstract class "Shape" and from there we will a generic asbtract method call "getVolume", and other shapes like Cone, Cylinder, etc. are able to extend and inherit from the Shape and customize their own getVolume.

Interfaces

We are also implementing an interface known as "InputChecker", it is a simple interface to make sure each shape will check the input.