阿摩線上測驗
登入
首頁
>
OJCP(SCJP)
>
104年 - SCJP 151-200#99330
> 申論題
156. Place the code fragments into position to use a BufferedReader to read in an entire text file.
相關申論題
169. Given: 12. NumberFormat nf = NumberFormat.getInstance(); 13. nf.setMaximumFractionDigits(4); 14. nf.setMinimumFractionDigits(2); 15. String a = nf.format(3.1415926); 16. String b = nf.format(2); Which two statements are true about The result if the default locale is Locale.US? (Choose two.) (A) The value of b is 2. (B) The value of a is 3.14. (C) The value of b is 2.00. (D) The value of a is 3.141. (E) The value of a is 3.1415. (F) The value of a is 3.1416. (G)The value of b is 2.0000.
#415280
176. Place the code fragments into position to produce the output: true true false CodeScanner scanner = new Scanner("One,5,true,3,true,6,7,false'');scanner.useDelimiter(",");
#415281
179. Place the Relations on their corresponding Implementation Structures. Note Not all Implementation Structures will be used.
#415282
180. Place the correct description of the compiler output on the code fragments to be inserted at lines 4 and 5. The same compiler output may be used more than once.
#415283
181. Place code into the class so that it compiles and generates the output answer = 42. Note: Code options may be used more than once.
#415284
182. Given the class definitions:
#415285
183. Place the code in the appropriate places such that this program will always output [1, 2].
#415286
184. Place each Collection Type on the statement to which it applies.
#415287
188. Given a pre-generics implementation of a method: 11. public static int sum(List list){ 12. int sum = 0; 13. for(Iterator iter = list.iterator(); iter.hasNext();){ 14. int i = ((Integer)iter.next()).intValue(); 15. sum += i; 16. } 17. return sum; 18. } What three changes allow the class to be used with generics and avoid an unchecked warning? (Choose three.) (A) Remove line 14. (B) Replace line 14 with "int i = iter.next();". (C) Replace line 13 with "for(int i : intList){". (D) Replace line 13 with "for(Iterator iter : intList){". (E) Replace the method declaration with "sum(List<int> intList)". (F) Replace the method declaration with "sum(List<Integer> intList)".
#415288
191. Given: 11. //insert code here 12. private N min, max; 13. public N getMin() { return min; } 14. public N getMax() { return max; } 15. public void add(N added) { 16. if(min == null || added.doubleValue() < min.doubleValue()) 17. min = added; 18. if(max == null || added.doubleValue() > max.doubleValue()) 19. max = added; 20. } 21. } Which two, inserted at line 11, will allow the code to compile? (Choose two.) (A) public class MinMax<?>{ (B) public class MinMax<? extends Number>{ (C) public class MinMax<N extends Object>{ (D) public class MinMax<N extends Number>{ (E) public class MinMax<? extends Object>{ (F) public class MinMax<N extends Integer>{
#415289
相關試卷
104年 - SCJP 201-244#99410
104年 · #99410
104年 - SCJP 51-100#99391
104年 · #99391
104年 - SCJP 151-200#99330
104年 · #99330
104年 - SCJP 1-50#41416
104年 · #41416
無年度 - SCJP 6.0 認證教戰手冊第二版 SCJP 6.0 認證教戰手冊第二版 認證教戰手冊第二版_題庫 201-244#83084
#83084
無年度 - SCJP 6.0 認證教戰手冊第二版 SCJP 6.0 認證教戰手冊第二版 認證教戰手冊第二版_題庫 151-200#83081
#83081
無年度 - SCJP 6.0 認證教戰手冊第二版 SCJP 6.0 認證教戰手冊第二版 認證教戰手冊第二版_題庫 101-150#83070
#83070
無年度 - SCJP 6.0 認證教戰手冊第二版 SCJP 6.0 認證教戰手冊第二版 認證教戰手冊第二版_題庫 51-100#83056
#83056