public class fin1 //super class
{
final int a=10;
}
public class fin extends fin1 // base class
{
public static void main(String arg[])
{
int a=12; int b=20;
fin f =new fin();
int c=a+b;
System.out.println(c); //ans is 32
c=f.a+b;
System.out.println(c); //ans is 30
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment