Q46.What is the output of the following piece of code 1. int x = 6;/ @: T$ f% e3 Q5 g0 X
2. double d = 7.7;
8 Q5 n2 W$ m" e: V 3. System.out.println((x>d) ? 99.9 : 9);* Q3 H1 e* M9 m& j1 |* r& C& j
a. 9
+ l$ h6 B, R1 q; p9 J. X+ J! Z+ m b. 9.0
8 [6 J4 _4 |7 c' K$ O! A c. 99.9
, s5 V$ U. O7 V. } d. Nothing, an ArithmeticException is thrown at line 3.7 b$ A# F- ?! j8 X
Q47.Which of the following are legal methods for the String class ?
; R2 p7 M& I; ~9 V/ t {; l+ u. R( F a. length()/ M& a: A- j9 _% K. @1 m
b. toUpper()
; L5 d4 J: q9 ^! g+ x9 M c. toUppercase()
, T- ^, r. `& y! {, ~, s d. equals()
7 L$ m0 ]( t$ N3 e Q48.Consider the following
; W5 J/ u; ^3 l; g 1. class A extends Integer {
' l, S( M" A9 \+ @. N' P! X7 U& [ 2. int x = 0;! @6 f8 \9 D( `! B7 }+ W6 J q
3. }
' i2 y. r# ~+ N; Z: x( e4 }2 b6 L a. The code will compile correctly.
8 c3 H3 R" x) q( V b. The code will not compile because Integer class is final.
8 P2 u. ^6 H8 O. r p1 f c. The code will not compile because A class doesn't have a constructor.
: o, L4 S" i2 ~ d. The code will compile but an ArithmeticException at runtime.& X# Z0 L8 q5 o0 g9 O: e* {& Q1 ^
46. b
$ |0 M! Y) @! c9 [; {; Z 47. ad) l T% n0 ?3 \) n3 b7 J% T
48. b |