Thursday, September 29, 2011

Quiz of the day | OCPJP (24)

3. public class J {
4. public static void main(String[] args) {
5. int j = 7;
6. assert(++j > 7);
7. assert(++j > 8): "Jakarta";
8. assert(j > 10): j=12;
9. assert(j==12): macet();
10. assert(j==12): new J();
11. }
12. static void macet() { }
13. }

Which are true? (Choose all that apply.)

A. Compilation succeeds
B. Compilation fails due to an error on line 6
C. Compilation fails due to an error on line 7
D. Compilation fails due to an error on line 8
E. Compilation fails due to an error on line 9
F. Compilation fails due to an error on line 10


DOWNLOAD the answer

0 comments: