Q103 If you ran the following program, what lines would be included in its output? class Question {. q- X) ~# F% n. B8 p
public static void main (String[] args)8 R1 c( G/ o9 M6 z
{
$ P+ t+ T0 i2 f( G/ q' K, d int i,j;6 d* d4 L: z6 `8 @; [2 e1 `1 S$ \
for(i=0, j=0; i+j < 20; ++i, j += i--)5 e9 e9 L: {% I
{
2 q1 z* |: ^5 q% k; z+ t3 r e System.out.println(i+j);2 X; Y. ~+ F2 N; S
}
1 z3 i: x* K0 t0 R9 b }. [! B6 m" p6 Y) B3 X7 F
}8 ^, A# F( g2 [
A 5. S# d4 L3 Y- D R6 J8 Z0 ?' w9 r% Q& U
B 88 w) S4 }- U/ \6 A0 R# W# i
C 13
- L4 ]7 L% ?4 F6 ^ D The program cannot be compiled because the for statement’s syntax is incorrect.
) V q b$ _. B Q104 What is the value of 9 + 8 % 7 + 6?
% Z1 ^ T. f' K) g A 17
: s; y% m: }/ |0 a4 `2 N7 [7 ^ B 16
9 I8 B+ _0 _/ I! z9 q C 13
- W" E3 f* f: b. S2 g' [2 r; N D 4: x X, c* o: ]
Q105 At which line in the following code is the Vector object created in line 4 first subject to garbage collection?3 U' X, w+ f* b# H0 {0 K
1. import java.util.*;$ f% Z2 \/ E- M
2. public class Question {
& v3 w7 |9 H/ M2 @- B; B+ m 3. public static void main(String[] args) {
P( F) {+ N. ]5 |% v 4. Vector v1 = new Vector();
7 m1 a! n5 @, F9 k 5. Vector v2 = new Vector();
- g! v" a) f$ ]8 ~+ T; I 6. v1.add(“This”);/ W" r) l* z2 x) i
7. v1.add(v2);9 L7 n, x* l6 J& y; v+ \
8. String s = (String) v1.elementAt(0);) W* A, [2 s' a/ t
9. v1 = v2;
: }) _% M& J: f5 Q: d( E4 h 10. v2 = v1;
& ?+ x0 C/ l: j% ^0 z: [# ]+ ?( \# L7 O 11. v1.add(s);
! H5 e& F' [# d) X8 X: k$ b 12. }5 V1 F( G0 ^( v- D3 o
13.}
" ^0 \! Q3 k* X& _+ @2 R$ V A line 51 ]+ i( ~1 Z- A1 u/ y8 [; D
B line 6
9 e6 c7 ~0 M- D: L, \: b" v C line 8# r6 l u+ T8 P1 k" I
D line 9$ h7 }- Q. ?, Y1 d1 v( I
Q103 ABC
8 n5 P0 m+ z" K& X" | Q104 B
* M9 |* H @/ J* } Q105 D |