Hi, there is no no-argument constructor in the superclass A, as a result, when the implicit call to super() from constructor in class B happens, there will be a compile time error.
Hope it helps.
Guoqiao
Originally posted by chao-long liao:
class A{
int x = 0;
A(int w){
x = w;
}
}
class B extends A{
int x = 0;
B(int w){
x = w +1;
}
}
What's wrong with the code???
Guoqiao Sun<br />SCJP2 SCWCD2<br />Creator of <a href="http://www.jiris.com/" target="_blank" rel="nofollow">www.jiris.com</a>, Java resource, mock exam, forum