What we have done over here is used Abstract method which can easily be used in different classes without writing the code again and again.
Classes used in the code Circle, Rectangle, Square, Sphere, Cylinder, Pyramid.
Created Shape as abstract class with showShape(String shape) as non-abstract method, with calculateShape()
Created Volume as an interface with calculateVolume() as an abstract method.
The code is user input based so for those finding a simpler code-there hasn't been one..