Q145 Which of the following lines of output are displayed by the following program? A% Q- P2 f) C8 R0 ]' K) x
class Question {
# g4 e5 j) {! x% b, I. q; _0 J4 k* ~ public static void main(String args[])- L4 i$ Z: J$ b! }
{' W7 X5 V* X) S" N
MyThread t = new MyThread();
( W7 E3 d1 d+ H+ I1 {# n9 H/ J t.displayOutput ( “ t has been
7 k+ r: h* ] V# f' \ created.”);
, E& K; n$ x: n* P t.start();% i4 J5 n# e, H* S2 ]1 h
}% q# ?3 E1 }) s$ n4 \( K: [
}
& k% h; `+ d) f H class MyThread extend Thread {
* j+ s9 u, V+ h7 Y- R+ r. r public void displayOutput (String s) {! |8 s+ e8 _' |
System.out.println(s);6 L+ }2 r6 Q- _2 [0 W
}+ Q% [6 p$ W6 u. H: [
public void run() {5 l, R! N& g6 d
displayOutput (“t is running.”);( `; D: \5 O, V/ i3 E1 C. J9 D
}% M- e- O, w& Y! n% L* U( Z
}0 F' a4 R9 z, k+ M5 _2 r9 _6 e
A t has been created.
) W( M& L; r! e% s) n: o B t is running.3 x+ ?& D) w) j, x! x" w+ I k0 _
C The program will display different output depending on whether the underlying operating system supports preemptive scheduling or time slicing.7 `3 ?9 R ~! }! q: U& x+ ?6 [, }
D None of the above. The program does not compile.
+ u) r) T2 ?& i+ a! x; H; Q Q146 Which of the following extend the Collection interface?1 [( B7 S$ H2 w
A Dictionary2 B; e8 T, X+ M6 j/ s4 P
B List# [& F- m N8 }0 P
C Map
* N0 \6 A# Q8 h$ q# b6 ^ D Set5 ?' H! j; O: o. l9 ?, l1 M2 K
Q147 Which of the following are true?% g- H0 v. e- s Y
A Java only supports preemptive scheduling.
9 n2 |% }) F: i B Java only supports time slicing.
0 [! Q* M. B* G C The JVM has been implemented on operating systems that use time slicing.! _5 y$ b5 l) v* e" P( [; S( L
D The JVM has been implemented on operating systems that use preemptive scheduling.
& b# ^2 [1 n+ J+ f. a( W' @% | Q145 AB
1 X6 H' \9 R) R6 Z0 D9 q$ ]' u Q146 BD4 `# s2 S8 B( R8 i" }* A
Q147 CD |