//write a program Demonstrate Inheritance.
import java.io.*;
class shape{
int b;
int h;
shape(){
b=0;
h=0;
}
void getdata(){
try{
InputStreamReader a=new InputStreamReader(System.in);
BufferedReader br=new BufferedReader(a);
System.out.println(“Enter the base:”);
String s=br.readLine();
b=Integer.parseInt(s);
System.out.println(“Enter the Height:”);
String s1=br.readLine();
h=Integer.parseInt(s1);
}
catch (IOException e){}
}
void view(){
System.out.println(“Base=”+b);
System.out.println(“Height=”+h);
}
}
class triangle extends shape{
void area(){
System.out.println(“Area of triangle=”+(0.5*h*b));
}
public static void main(String args[])throws IOException{
triangle t=new triangle();
t.getdata();
t.view();
t.area();
}
}
Home      |      About Us      |     Portfolio      |      Services      |      Courses      |     Career      |      Cost      |      Contact Us
Services
  SEO   
  Link Building
  Data Entry
  Web Design and development
  Web Application development
 

Graphic and multimedia

  E-Commerce Solutions
  Software development
  Web Marketing & Promoting
  Internet Marketing
  IT Outsourcing
  Multimedia/CD Presentation
  Synopsis Ideas
  Project Ideas
  Placement Papers
  Live Project Training
  Programming & Projects
  Faq
  Training @balujalabs
 
 
Method
 

Differentiate Accers Modifiers.

 

 

 

 

 

 

 

 

 

                                                                                                                                          

1

Program To Demonstrate

2

Application of Single Inheritance

3 Application of Super ( ) In Inheritance.
4 Use Of Constrictors in Constrictors in
5

To Demonstrate Method Oveiloediey

6

Differentiate Accers Modifiers.