Devise a program to create an abstract class named Shape that contain an empty method named numberOfSides(). Provide thr
Posted: Tue May 24, 2022 8:09 am
Devise a program to create an abstract class named Shape that contain an empty method named numberOfSides(). Provide three classes named Trapezoid, Triangle and Hexagon such that each one of the classes extends the class Shape. Each one of the class contains only the method numberOfSides() that shows the number of sides in the given geometrical figures. Sample input1: Tapezoidal Sample Output1: Number of sides=4. Sample input2: Triangle Sample Output2: Number of sides=3. Sample input3: Hexagon Sample Output3: Number of sides-6. 110M]