Categories
Uncategorized

Hierarchal Inheritance

Simple program for Hierarchal inheritance import java.util.Scanner; class rectangle { double length,breadth,radius,heigth; Scanner a=new Scanner(System.in); void get() { System.out.println(“enter length and breadth:”); length=a.nextDouble(); breadth=a.nextDouble(); } void display() { double ar; ar=length*breadth; System.out.println(“Area of Rectangle:”+ar); } }