Q40.Which keyword, when used in front of a method, must also appear in front of the class. a. synchronized; L- h1 Q8 @$ K5 F( U( O. W% W
b. abstract
( c# m9 s* S+ x/ u c. public" [, D! b0 [# ]8 M
d. private
( u' k& I8 p# K* h: B+ q Q41.Given this code snippet,) Q4 J/ e& R6 j+ R. a
1. try {9 k, G% Y* z$ j$ C" y7 W
2. tryThis();- E* J* K0 V2 D& }4 M$ ?
3. return;
/ Q! n! q! b+ d3 S7 s2 }1 a 4. } catch(IOException x1) {: h/ v" p' b" o" F5 ?7 L$ @
5. System.out.println(“exception 1”);8 m: _2 L3 X5 A
6. return;4 N9 E/ X- s2 I! l: i
7. } catch(Exception x2) { N* X4 l9 Q% M) w1 q
8. System.out.println(“exception 2”);
0 p( j0 {3 F# a; m) B; G9 k# J8 |% d u 9. return;/ Z3 S' H5 i l# @0 H, A
10. } finally {3 w; U5 M$ S' B, n [9 L; q
11. System.out.println(“finally”);: q% ]+ ?! r4 z8 C! `6 W9 \- O
12. }
, \/ k( w0 g% v- w1 v+ @ what will appear in the standard output if tryThis() throws a IOException?
( P3 j: X6 {) j' D7 O, I a. “exception 1” followed by “finally”
/ Z! L; o7 F( R/ f b. “exception 2” followed by “finally”! t: s8 Q% U# F4 g
c. “exception 1”4 i* l9 r5 G2 R2 j, y2 Y# `, [
d. “exception 2”5 f2 B& l, n! F
Q42.Given the code snippet,
4 j) x- e- J) r0 T5 t% I: `; `# u 1. double a = 90.7;5 L. R6 J t& J% H) k# j
2. double b = method(a);5 \; M, A) M) e$ S$ [
3. System.out.println(b);& n, V( B$ O( e3 M
if this snippet displays 90.0 in the standard output, what Math method did method() invoke? Select all valid answers.
" R( W3 u. U3 o d) `; P; f a. abs(). z6 I7 X) x0 j+ g) t8 R& u
b. round()! o3 x6 A9 ^; i7 J4 O
c. floor(). h d" s* j4 \6 a& q$ W, N ?5 M% ^
d. ceil()1 Q* b L) X# ?0 p! y+ |
40. b
4 \# @& l1 ]; Q* x/ Z8 b 41. a _" y" K' J' z! H. ]9 K! ?- ?
42. c |