You are on page 1of 1

package javaapplication1;

public class FirstClass1{


int a;float b;
private String name = "Animesh";
//
FirstClass1()
//
{
//
System.out.println("Inside parent class constructor");
//
a=4;
//
b=3.4f;
//
}
protected void method1()
{
System.out.println("String Name is " +name);
}
}
public class JavaApplication1 extends FirstClass1{
int a;
JavaApplication1(int b)
{
super();
a = b;
System.out.println("value of a in child constructor "+a);
}
void method2()
{
System.out.println("Value of a "+super.a);
System.out.println("Value of b "+super.b);
super.method1();
method1();
}
public void method1(){System.out.println("Hello java");}
public static void main(String args[]){
JavaApplication1 obj=new JavaApplication1(10);
obj.method2();
}
}