Language : Java (Polymorphism)
2. Write a program to create a class named shape, which have two sub classes two dimensional and three dimensional shapes. The two dimensional shape have three sub classes: circle, triangle and square, and contain calArea() method to calculate the area. While the three dimensional shape have two sub classes: cube and sphere and have calArea) and calVolume() methods to calculate the surface area and volume, respectively. Create a program that implements
OR
OR