Q91 After which line in the following code is the Vector object, created in line 4, first subject to garbage collection?
9 k+ t g5 W/ L4 U& x 1. import java.util.*;; F9 d- d% n; T3 M5 M
2. public class Question {
5 d2 n' q5 k7 J" k3 H% F 3. public static void main(String[] args) {
5 a: {( u f3 X' Z# A R' ~ 4. Vector v1 = new Vector();1 ~$ y1 \! p9 A# J a
5. Vector v2 = new Vector();
+ d& F% C" b" J+ Q: D' g 6. v1 = null;+ ]0 ^8 i# R# n# b4 {" F
7. Vector v3 = v1;
: b: ]( B% [+ D4 c5 N: O1 |6 A 8. v1 = v2;8 y. g7 K5 I6 n, |
9. v1.add(“This”);
n% G+ S$ T! X' n3 A+ T 10. v1.add(v2);
7 t7 e8 n: g6 T) X 11. String s = (String) v1.elementAt(0);
( B$ ? G! V3 O* N/ f2 l 12. v1 = v2;: K) k, Y$ w# N0 K) \
13. v2 = v1;
. l! P0 h% Y* o5 O! ]' }' j, u 14. v1.add(s);
2 r# r b" n s 15. }" E2 Q; f+ z" T
16.}7 ~2 C( z( j. T' t! X
A line 6
; m5 [" M9 j% ~ B line 7
0 C2 M& D9 q) p- i+ i, x( ? C line 8; i% s; d! C; I9 A9 \5 q
D line 12
6 c/ q2 y/ h% v; m7 V, X1 G Q92 In order for the public class MyClass to successfully compile, which of the
3 _; ^" @0 @7 I following are true?
. a& L9 H, Q( ]$ z# |4 H% w A MyClass must have a correctly formed main() method.
5 Z$ M% _) l p3 c B MyClass must be defined in the file MyClass.java
) u, }3 s: h% S& A1 [. B C MyClass must be defined in the MyClass package+ {+ g' ]2 q) B! M& S5 p3 H& D
D MyClass must be imported.) v2 W' z o3 d) {" m
Q93 Which of the following are true about the Error and Exception classes?" O6 }) E: U9 D
A Both classes extend Throwable.& e+ J6 k) g1 v) B1 c8 R* Y
B The Error class is final, and the Exception class is not.
6 `( X" w; x+ o9 k; e! B C The Exception class is final and the Error class is not.1 Y: ~; O# o1 _/ M0 H1 B% i% W
D Both classes implement Throwable.
7 @5 I. m# g. C m1 U Q091 A
* N2 o+ l# s" y Q092 B* J' V1 {5 }; \) z' @
Q093 A |