/*Write a java program that creates an abstract class called Shape.Create two subclasses Rectangle and Triangle.Include appropriate methods for both the subclasses that calculates and display the area of the rectangle and triangle AIM:To create an abstract class called shape and to create 2 subclasses rectangle and triangle and calculate their area*/ abstract class Shape { abstract void calc(double a,double b); } class Rectangle extends Shape { void calc(double l,double b) { System.out.println("Area of rectangle:"); double area_rec=l*b; System.out.println(area_rec); } } class Triangle extends Shape { void calc(double b,double h) { System.out.println("Area of triangle:"); double area_tri=(double)0.5*b*h; System.out.println(area_tri); } } class area { public static void main(String args[]) { Rectangle rec=new Rectangle(); rec.calc(10,20); Triangle tri= new Triangle(); tri.calc(10,20); } }