Tuesday, September 6, 2011

Quiz of the day | OCPJP (1)

Given:

public class A extends B {
A() {
System.out.println("a ");
}
public static void main(String[] args) {
new A();
}
}
class B extends C {
B() {
System.out.print("b ");
}
private B(String b) {
}
}
abstract class C {
C() {
System.out.print("c ");
}
}

What is the result?

A. a
B. a b
C. b a
D. a b c
E. c b a
F. Compilation fails due to a single error in the code.
G. Compilation fails due to multiple errors in the code.

DOWNLOAD the answer

0 comments: