hi Akthari,
i think its coz class D is declared abstract .. check this code it now prints EA & DA ..
this what i think .. i'm just trying to help u.. i'm not sure abt the answer .. ok?
abstract class D {
String s1 = "D";
String getS1() {return s1;}
}
abstract class E extends D {
String s1 = "E";
String getS1() {return s1;}
}
class A extends E {
String s1 = "A";
String getS1() { return s1; }
}
class F {
public static void main (String[] s) {
E x = new A();
D y = new A();
System.out.print(x.s1 + x.getS1());
System.out.print(y.s1 + y.getS1());
}
}
Only those who will risk going too far, Can possibly find out how far one can go! <br />happiness is journey and not destination<br /> <br />A Nayak<br />----------------------------------<br />SCJP 1.4<br />SCWCD 1.3<br />SCBCD 1.3