34. Given the following method body:
% I0 s) z% A0 ~/ p% P{- |. v! w4 {! G! p7 U' X0 S
if (sometest()) {
9 h! R+ z9 J$ G6 Xunsafe();! ]/ e2 a0 H7 d. }7 |
}
4 s1 T& V5 N O3 q( k+ Oelse {
9 D6 ~3 f+ }9 z, K9 csafe();$ v$ C6 }* K, P8 q; k. I/ ?
}4 o; Q& k) V6 m+ V8 N
}
$ d9 I( a9 @) }8 O8 qThe method "unsafe" might throw an IOException (which is not a subclass of RunTimeException). Which correctly completes the method of declaration when added at line one?
6 b: [$ m V# L9 R" U5 QA. public void methodName() throws Exception5 q# a5 M# k* [5 v
B. public void methodname()
3 r% b( N: Y' o8 `# x# QC. public void methodName() throw IOException
5 u0 Q. E+ h" a+ n9 C! l5 ]D. public void methodName() throws IOException
, o4 m$ o0 p( \/ E3 R- D0 FE. public IOException methodName()
3 f+ ~. n5 \/ i& vAD.
7 H+ V) F u* _. r, k& T7 N4 B8 O35. What would be the result of attempting to compile and run the following piece of code?
Z! Y/ \0 _ m' k- e+ N8 x
5 t& p8 r/ ~) j$ cpublic class Test {
7 a2 `' ^ n0 S& N8 h& y/ Z' Wstatic int x;( S3 b3 H+ H- {
public static void main(String args[]){: ?4 s* W5 [7 q
System.out.println("Value is " + x);
/ e' x3 b i/ K}% l7 Y: \0 h- a5 Y! I
} |