Tuesday, October 4, 2011

Quiz of the day | OCPJP (29)

Given:

3. public class Bunga {
4. public enum Kembang { MAWAR, SETAMAN, DESA };
5. public static void main(String[] args) {
6. for(Kembang k : Kembang.values() )
7. ;
8. Kembang [] k2 = Kembang.values();
9. System.out.println(k2[2]);
10. }
11. }

What is the result? (Choose all that apply.)

A. SETAMAN
B. DESA
C. The output is unpredictable
D. Compilation fails due to an error on line 4
E. Compilation fails due to an error on line 6
F. Compilation fails due to an error on line 8
G. Compilation fails due to an error on line 9


DOWNLOAD the answer

0 comments: