import [Link].
Scanner;
abstract class Shape{
abstract void area();
}
class Square extends Shape{
void area(){
[Link]("Enter the side of the square in centimeter");
Scanner scan=new Scanner([Link]);
int side=[Link]();
[Link]("The area of the square is: "+(side*side)+" square
centimeter");
}
}
class Cube extends Shape{
void area(){
[Link]("Enter the side of the cube in centimeter");
Scanner scan=new Scanner([Link]);
int side=[Link]();
[Link]("The surface area of the cube is: "+(6*side*side)+"
square centimeter");
}
}
class MainInheritHier{
public static void main(String[] args){
Shape s;
Square sq=new Square();
Cube cu=new Cube();
s=sq;
[Link]();
s=cu;
[Link]();
}
}