class Base
{
  int b1,b2;
  Base()
 {
   b1=10;
   b2=20;
 }
 void displayb()
 {
  System.out.println("the value  is" +b1);
  System.out.println("the value is" +b2);
 }
}
class Derived1 extends Base
{
  int d1,d2;
  Derived1()
 {
  d1=30;
  d2=40;
 }
 void display1()
 {
    super.displayb();
   System.out.println("the value is" +d1);
   System.out.println("the value is" +d2);
 }
}
class Derived2 extends Base
{
   int a1,a2;
   Derived2()
  {
   a1=32;
   a2=43;
  }
  void display2()
  {
   super.displayb();
   System.out.println("the value is" +a1);
   System.out.println("the value is" +a2);
 }
}

class Demo
{
 public static void main(String args[])
 {
   Derived1 d=new Derived1();
   Derived2 s=new Derived2();
   d.display1();
   s.display2();
 }
}
  
/* OUTPUT */
C:\Documents and Settings\Lenovo>cd\

C:\>set path="C:\Program Files\Java\jdk1.6.0_24\bin";

C:\>cd vishu

C:\vishu>javac Demo.java

C:\vishu>java Demo
the value  is 10
the value is 20
the value is 30
the value is 40
the value  is 10
the value is 20
the value is 32
the value is 43   
