Q46.What is the output of the following piece of code 1. int x = 6;. M, O, h `% ?! `! V
2. double d = 7.7;% ^( z+ M: o1 I* x* P
3. System.out.println((x>d) ? 99.9 : 9);
0 i# Z. \# p Q+ B* P a. 9' S1 E# d- g6 ^( r
b. 9.0
N: e8 l; G' _; P% o& ?$ `+ q c. 99.94 T% }! v5 z: }; ?; i, y' q! f
d. Nothing, an ArithmeticException is thrown at line 3.1 n. p, i1 W) V+ ^5 {+ b
Q47.Which of the following are legal methods for the String class ?! B5 j- r6 b$ R/ W, S2 z9 ~0 g
a. length()
. ?9 N/ l) d# Z; {7 L4 o; N4 Z" @ b. toUpper(). t6 _4 p; F& a6 [6 O8 I2 V
c. toUppercase()/ ~) L: x% M! _
d. equals()
& G4 w# I6 L: S% ~) ` Q48.Consider the following
+ |+ n# a; y% j/ M. U/ h, ] 1. class A extends Integer {, c" |3 i. A+ S9 E! r& K" z5 @
2. int x = 0;: A# R( M' @ e) L8 n
3. }
. H' U; x: j9 S a. The code will compile correctly.
" q. d! L+ f+ n5 x" W. ` b. The code will not compile because Integer class is final.
1 M' y) n$ n3 X0 v c. The code will not compile because A class doesn't have a constructor.
" f& ?' `- Y9 F9 B2 _2 e8 Q d. The code will compile but an ArithmeticException at runtime.
7 W% A' k/ q. k 46. b
, A2 |7 w5 ^% G1 a9 L8 G 47. ad3 S4 G/ A! l' |, X
48. b |