Geometry Program With Interface
Description
This program incorporates OOP Interface concept to design classes to represent different three dimensional shapes such as cube, cylinder, Cone, and etc.An interface called ThreeDimensionalShape is used to declare abstract methods.
calculateArea()
calculateVolumn()
calculateVolumn()
Classes such as Cube or Cylinder or Cone implements the interface.
Therefore, they must override the abstract methods declared in the interface.
Associated Concepts:
OOP - Interface
Algorithm:
Class diagrams:
Client program:
Client program:
The client program uses the interface reference variables to
refer to the actual objects.
It then uses the interface variables to invoke the objects' methods.
It then uses the interface variables to invoke the objects' methods.
Source Code
Interface ThreeDimensionalShapeCube class