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

{

double radius;

void get()

{
super.get();

Scanner a=new Scanner(System.in);

System.out.println(“Enter the Radius:”);

radius=a.nextDouble();

}

void display()

{

super.display();

double ar;

ar=3.14*radius*radius;

System.out.println(“Area of circle:”+ar);

}

}

class sphere extends circle

{

void display()

{

super.display();

double ar;

ar=4*3.14*radius*radius;

System.out.println(“Area of Sphere:”+ar);

}

}

class area1

{

public static void main(String args[])

   {

   sphere s=new sphere();

   s.get();

   s.display();

  }

   }


78 replies on “Multilevel Inheritance”

Definitely believe that which you said. Your favorite justification appeared to be on the web the easiest thing to be aware of. I say to you, I certainly get irked while people consider worries that they just don’t know about. You managed to hit the nail upon the top and also defined out the whole thing without having side-effects , people could take a signal. Will likely be back to get more. Thanks

Sweet blog! I discovered it while surfing
around on Yahoo News. Have you got any suggestions concerning how to get placed in Yahoo News?
I’ve been trying for a while however i never appear to arrive!
Appreciate it

I just want to say I am newbie to blogging and site-building and honestly loved you’re blog. Very likely I’m planning to bookmark your website . You surely come with perfect stories. Thank you for sharing with us your website page.

obviously like your website however you have to test the spelling
on several of the posts. Several seem to be rife with spelling problems and so
i in locating it very troublesome to know the
truth however I will surely come back again.

Thanks for any marvelous posting! I quite enjoyed reading it, you can be a fantastic author.
I am going to always bookmark your blog site and will revisit sometime soon. I would
like to encourage continue your great work, possess a nice evening!

You really ensure it is seem so easy with your presentation but I find this matter to be really something that I believe I would never understand.
It appears too complicated and extremely broad for me personally.
I am anticipating for your forthcoming post, I’ll try to find the hang from it!

I just want to mention I’m newbie to weblog and honestly enjoyed you’re web blog. Very likely I’m want to bookmark your blog post . You amazingly have beneficial stories. Thanks for sharing with us your website page.

I simply want to say I am new to weblog and absolutely loved your blog. More than likely I’m want to bookmark your site . You definitely come with perfect well written articles. Thanks a lot for sharing your web-site.

I simply want to say I am just very new to weblog and seriously enjoyed you’re web site. Probably I’m going to bookmark your website . You certainly have outstanding stories. Many thanks for sharing with us your website.

I just want to mention I am just very new to blogs and absolutely enjoyed this web site. Probably I’m likely to bookmark your blog . You surely have excellent writings. Appreciate it for sharing your web site.

I simply want to say I am just newbie to blogging and site-building and really savored you’re web page. Most likely I’m likely to bookmark your blog . You surely have really good writings. Cheers for sharing your webpage.

Hi there! Quick question that’s completely off topic.
Do you know how to make your site mobile friendly?
My weblog looks weird when viewing from my iphone. I’m trying
to find a theme or plugin that might be able to resolve this problem.

If you have any suggestions, please share. Many thanks!

Comments are closed.