Q34.What String instance method would return true when invoked as follows?; p8 v8 [8 G$ D8 `
1. a.method(b); where a equals “GROUNDhog” and b equals “groundHOG”?
; h) p' y4 b; u4 E+ _. z9 D% u: f4 z a. equals()
4 C/ ]/ c) u- G4 g7 c b. toLowerCase()
$ [2 Z4 t. r" b3 | c. toUpperCase()9 c! f; h4 q5 [
d. equalsIgnoreCase()
0 h9 q9 @3 V8 R$ B- _1 m0 h$ @. n Q35.What access control keyword should you use to enable other classes to access a method freely within its package, but to restrict classes outside of the package from accessing that method? Select all valid answers.
. h* I3 i9 n3 g4 x8 l: J a. private& p) M; N9 {; e* d* O" k0 X
b. public6 Y8 p7 { P# [7 L
c. protected
J# u, }( q& {. z& } a$ ^) e d. Do not supply an access control keyword (friendly).) C8 B, B7 t; _ V& A8 c7 M! P
Q36.What letters are written to the standard output with the following code?
7 x# t( M& y5 A- J) k% ?7 ? 1. class Unchecked {
5 T2 v% _+ u+ } 2. public static void main(String args[]) {
% T% {( l/ E$ r 3. try {
2 A/ x4 O, T) G9 q( l 4. method();
# H5 @9 A" s5 _' f. |& u9 t) | 5. } catch(Exception e) { }
1 h# W* X! V4 \8 A: \ 6. }
2 z& J9 y% i/ d" m 7. static void method() {* g5 E3 q# |, m3 P7 j' X
8. try {% B( i) k' n' J4 a( f& I
& [! ?6 h7 ]7 m) W: b# b$ {0 q0 w 9. wrench(); |