Hi friends,
public class Child extends Base {
Child(int i) {
test (); }
Child(float f) { this ((int)f); }
void test() {
System.out.println("Child.test()");
}
static public void main(
String[] a) {
new Child(10.8f).test();
}
}
Select most appropriate answer.
a) Child.test()
Child.test()
b) Compilation Error: No default constructor ( constructor matching Base())
found in class Base.
c) Runtime Error: No default constructor ( constructor matching Base())
found in class Base.
d) Compilation Error: Cannot call this() from a constructor.
The Answer to this question in given as ...a)
Why does Child.test() print twice ?
-Thanks