class base{
int a,b;
void showbase()
{
System.out.println(“A=”+a+”\nB=”+b);
}
void addbase(){
System.out.println(“a+b=”+(a+b));
}
}
class derived extends base{
int c;
void showderived(){
System.out.println(“C=”+c);
}
void derivedsum(){
System.out.println(“A+B+C=”+(a+b+c));
}
}
class mainclass{
public static void main(String args[]){

derived ob1=new derived();
ob1.a=20;
ob1.b=30;
System.out.println(“Base class”);
ob1.showbase();
ob1.addbase();
System.out.println(“Derived class”);
ob1.c=22;
ob1.showderived();
ob1.derivedsum();
}
}

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
 

Application of Single Inheritance

 

 

 

 

 

 

 

 

 

                                                                                                                                          

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.