Categories
Uncategorized

Multilevel Inheritance

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