</p> 1. class Tester {: Z7 j, ~( p9 K1 W3 g
2. void test (int i) { System.out.println (“int version”); }5 i2 X$ o& ^# g3 k* ]' w1 Q
3. void test (String s) { System.out.println (“String version”); }* D4 u) V" n- g$ `# u! b6 g. O
4.
. i0 ?- Z5 d3 Z+ z4 b 5. public static void main (String args[]) {6 N( Z2 L/ S. ?1 R! s" k. e
6. Tester c = new Tester ();
- ?2 N- h% D ~' |3 D/ ` 7. char ch = 'p';
% I/ w/ S0 i/ J: ^8 a" Q 8. c.test (ch);
1 T9 o3 e/ p5 S" P 9. }
/ D0 |. V5 N. W& F6 W 10. }
8 C0 R, Z! y8 l5 s Which of the following statements below is true?(Choose one.)6 H1 U& K3 ~7 W- O
a. Line 3 will not compile, because void methods cannot be overridden.6 A, ?$ b5 } U. M
b. Line 8 will not compile, because there is no conversion of test() that takes a char argument.
& n) r2 ^/ m+ `+ E( E g! U c. The code will compile and produce the follwing output “int version”
) t- l {" h; G& X d. The code will compile and produce the follwing output “String version”
1 R' ^. ]' h' O) F Q18.You are creating a ToolBase class which will be extended by other programmers. The ToolBase class contains a single abstract method, createTool. Which of the following statements are true?
' ]" G) L9 O# L& ? a. The ToolBase class must be declared abstract." d/ @/ s6 D- @. N3 Q4 A A
b. Classes extending ToolBase must not be declared abstract.
& L8 [5 s5 \7 r& d( y% i& m, m c. The ToolBase class must not be declared final.; F" N( c7 ~! ]( j) ^2 u# Y$ }( _3 n
d. The following variable declaration is illegal in any context “ToolBase myTB;”
& C- H* c8 }5 J) B/ w 16. d* M# d0 Q& w5 X
17. c1 [* i: J' R* ?/ m- ~
18. ac |