Saturday, October 1, 2011

Quiz of the day | OCPJP (26)

Given:

1. enum Kewan {
2. KIRIK("guk"), KUCING("meong"), WEDUS("mbek");
3. String suoro;
4. Kewan(String s) { suoro = s; }
5. }
6. class Enum {
7. static Kewan a;
8. public static void main(String [] args) {
9. System.out.println(a.KIRIK.suoro + " " + a.WEDUS.suoro);
10. }
11. }

What is the result?

A. guk mbek
B. Multiple compilation errors
C. Compilation fails due to an error on line 2
D. Compilation fails due to an error on line 3
E. Compilation fails due to an error on line 4
F. Compilation fails due to an error on line 9


DOWNLOAD the answer

0 comments: