Friday, 26 September 2014

A program using "super" function


class a
{
int a1,a2;
public int a3=5;
void disp()
{
System.out.println("the value of a3 in class a");
System.out.println(a3);
}
}

class b extends a
{
public int b1,b2;
void disp()

{
super.disp();
b1=4;
b2=10;
System.out.println("value of b1,b2 :");
System.out.println("value assign for i1 and i2 is" +b1+" "+b2);
}
}

public class mc3
{
public static void main(String arg[])
{
b a1=new b();
a1.disp();
}
}


No comments:

Post a Comment