class Super {
int i=0;
public Super()
{
System.out.println("A");
i=1;
}
public Super(char a)
{
System.out.println("B");
i+=2;
}
}
class Demo extends Super
{
public Demo(String a)
{
System.out.println("C");
i=5;
}
public static void main(String[] args) {
int i=4;
Super s = new Demo("a");
System.out.println(s.i);
}
}
|
|