週三"阿摩用功日",VIP免費領取 前往
limmimm54>試卷(2020/02/19)

OJCP(SCJP)題庫 下載題庫

-1910 年 - SCJP 6.0 認證教戰手冊第二版 SCJP 6.0 認證教戰手冊第二版 認證教戰手冊第二版_題庫 151-200#83081 

選擇:40題,非選:10題
立即測驗 
我要補題 回報試卷錯誤
1.重新載圖151  5e4cf3207fc08.jpg
Which statement is true?
(A) Compilation fails.
(B) Nothing is added to the file system.
(C) Only a new file is created on the file system.
(D) Only a new directory is created on the file system.
(E) Both a new file and a new directory are created on the file system. .


2.152 Which three statements concerning the use of the java.io.Serializable interface are true? (Choose three.)
(A) Objects from classes that use aggregation cannot be serialized.
(B) An object serialized on one JVM can be successfully deserialized on a different JVM.
(C) The values in fields with the volatile modifier will NOT survive serialization and deserialization.
(D) The values in fields with the transient modifier will NOT survive serialization and deserialization.
(E) It is legal to serialize an object of a type that has a supertype that does NOT implement java.io.Serializable. .

3.154 Given that c is a reference to a valid java.io.Console object, which two code fragments read a line of text from the console? (Choose two.)
(A) String s = c.readLine();
(B) char[] c = c.readLine();
(C) String s = c.readConsole();
(D) char[] c = c.readConsole();
(E) String s = c.readLine("%s", "name "); 
(AB) char[] c = c.readLine("%s", "name ");
.

4.重新載圖157  5e4cf5f522465.jpg
If the user types fido when prompted for a password, and then responds bob when prompted for a name, what is the result?
(A) pw: got fido name: bob got bob
(B) pw: fido got fido name: bob got bob
(C) pw: got fido name: bob got bob
(D) pw: fido got lido name: bob got bob
(E) Compilation fails. 
(AB) An exception is thrown at runtime.
.


5.重新載圖158  5e4cf616e68e2.jpg
 What updates d's value with the date represented by ds?
(A) 18. d = df.parse(ds);
(B) 18. d = df.getDate(ds); 
(C)  5e4cf66807804.jpg
(D)  5e4cf6571d85e.jpg.


6.重新載圖159  5e4cf693e1ec8.jpg
Which code, inserted at line 14, sets the value of b to 314.159,26?
(A) b = nf.parse(input);
(B) b = nf.format(input);
(C) b = nf.equals(input);
(D) b = nf.parseObject(input); .


7.重新載圖160  5e4cf72aba3bb.jpg
Which code fragment, inserted at line 24, outputs "123abc 123abc"?
(A) sb1.append("abc"); s1.append("abc");
(B) sb1.append("abc"); s1.concat("abc");
(C) sb1.concat("abc"); s1.append("abc");
(D) sb1.concat("abc"); s1.concat("abc");
(E) sb1.append("abc"); s1 = s1.concat("abc"); 
(AB) sb1.concat("abc"); s1 = s1.concat("abc"); 
(AC) sb1.append("abc"); s1 = s1 + s1.concat("abc"); 
(AD) sb1.concat("abc"); s1 = s1 + s1.concat("abc");
.


8.重新載圖161  5e4cf75961651.jpg
What is the result?
(A) The value "4" is printed at the command line.
(B) Compilation fails because of an error in line 5.
(C) Compilation fails because of an error in line 9.
(D) A NullPointerException occurs at runtime.
(E) A NumberFormatException occurs at runtime. (AB) An IllegalStateException occurs at runtime. .


9.重新載圖162  5e4cf78282b3e.jpg
What is the result?
(A) three
(B) other
(C) An exception is thrown at runtime.
(D) Compilation fails because of an error on line 12.
(E) Compilation fails because of an error on line 13. 
(AB) Compilation fails because of an error on line 15.
.


10.重新載圖163  5e4cf7a701e1b.jpg
Which two code fragments, inserted independently at line 3, generate the output 4247? (choose two.) 
(A)  5e4cf7d7952d2.jpg
(B)  5e4cf7e344ad5.jpg
(C)  5e4cf7f4394f4.jpg
(D)  5e4cf802294ca.jpg
(E)  5e4cf80f648c5.jpg.


11.重新載圖164  5e4cf837c41fa.jpg
 What outputs the current locale's country name and the appropriate version of d's date? 
(A)  5e4cf86c25765.jpg
(B)  5e4cf879609f5.jpg
(C)  5e4cf884bf57b.jpg
(D)  5e4cf891d1a02.jpg.


12.重新載圖165  5e4cf8daaf324.jpg
Which code fragment, inserted at line 23, allows the code to compile?
(A) df = new DateFormat();
(B) df = Date.getFormat();
(C) df = date.getFormat();
(D) df = DateFormat.getFormat();
(E) df = DateFormat.getInstance(); .


13.重新載圖166  5e4cf90e85f4e.jpg
What is the result?
(A) 7
(B) 49
(C) 343
(D) Compilation fails.
(E) An exception is thrown at runtime. .


14.重新載圖167  5e4cf93eedbee.jpg
Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"?
(A) String regex = "";
(B) String regex = " ";
(C) String regex = ".*";
(D) String regex = "s";
(E) String regex = ".s*"; 
(AB) String regex = "w[.] +";
.


15.重新載圖168  5e4cf95a52b9c.jpg
What is the result when method testIfA is invoked?
(A) True
(B) Not true
(C) An exception is thrown at runtime.
(D) Compilation fails because of an error at line 12.
(E) Compilation fails because of an error at line 19. .


16.重新載圖169  5e4cf97742ff2.jpg
Which two statements are true about the result if the default locale is Locale.US? (Choose two.)  
1. The value of b is 2.  
2. The value of a is 3.14.  
3. The value of b is 2.00.  
4. The value of a is 3.141.  
5. The value of a is 3.1415.  
6. The value of a is 3.1416.  
7. The value of b is 2.0000.
(A) 13
(B) 24
(C) 47
(D) 36
.


17.重新載圖170  5e4cf9a0bce75.jpg
What is the result?
(A) Compilation fails.
(B) After line 15, the value of age is 5.
(C) After line 15, the value of age is 3.
(D) An exception is thrown at runtime. .


18.重新載圖171  5e4cf9bb3f70f.jpg
What is the result?
(A) a b c
(B) 1 2 3
(C) a1b2c3
(D) a1 b2 c3
(E) Compilation fails. (AB) The code runs with no output. (AC) An exception is thrown at runtime. .


19.重新載圖172  5e4cf9ebbae34.jpg
What creates the appropriate DateFormat object and adds a day to the Date object? 
(A)  5e4cfa1062ddf.jpg
(B)  5e4cfa1cabc66.jpg 
(C)  5e4cfa297d038.jpg
(D)  5e4cfa3688918.jpg.


20.重新載圖173  5e4cfa62f037e.jpg
What is the result?
(A) int Long
(B) Short Long
(C) Compilation fails.
(D) An exception is thrown at runtime. .


21.重新載圖174  5e4cfa86052b6.jpg
What is the result if this code is run on December 14, 2000?
(A) The value of s is 14-dic-2000.
(B) The value of s is Dec 14, 2000.
(C) An exception is thrown at runtime.
(D) Compilation fails because of an error in line 13. .


22.175 Which two scenarios are NOT safe to replace a StringBuffer object with a StringBuilder object? (Choose two.)
(A) When using versions of Java technology earlier than 5.0.
(B) When sharing a StringBuffer among multiple threads.
(C) When using the java.io class StringBufferInputStream.
(D) When you plan to reuse the StringBuffer to build more than one string.
(E) Enitiation of separate design processes to the separation of users .

23.重新載圖177 
5e4de168103a7.jpg
What is the result?
(A) 0
(B) 1
(C) 4
(D) Compilation fails.
(E) An exception is thrown at runtime.
.


24.重新載圖178 
5e4de13b146e6.jpg
Which change can you make to Target without affecting Client?
(A) Line 4 of class Target can be changed to return i++;
(B) Line 2 of class Target can be changed to private int i = 1;
(C) Line 3 of class Target can be changed to private int addOne(){
(D) Line 2 of class Target can be changed to private Integer i = 0;
.


25.重新載圖185 
5e4de37a20190.jpg
Which statement is true?
(A) The equals method does NOT properly override the Object.equals method.
(B) Compilation fails because the private attribute p.name cannot be accessed in line 5.
(C) To work correctly with hash-based data structures, this class must also implement the hashCode method.
(D) When adding Person objects to a java.util.Set collection, the equals method in line 4 will prevent duplicates.
.


26.186 Which two statements are true about the hashCode method? (Choose two.)
(A) The hashCode method for a given class can be used to test for object equality and object inequality for that class.
(B) The hashCode method is used by the java.util.SortedSet collection class to order the elements within that set.
(C) The hashCode method for a given class can be used to test for object inequality, but NOT object equality, for that class.
(D) The only important characteristic of the values returned by a hashCode method is that the distribution of values must follow a Gaussian distribution.
(E) The hashCode method is used by the java.util.HashSet collection class to group the elements within that set into hash buckets for swift retrieval. .

27.重新載圖187 
5e4de3a3869bd.jpg
 Which method will complete this class?
(A) public int compareTo(Object o){/* more code here */}
(B) public int compareTo(Score other){/* more code here */}
(C) public int compare(Score s1, Score s2){/* more code here */}
(D) public int compare(Object o1, Object o2){/* more code here */}
.


28.重新載圖188 
5e4de3d452b67.jpg
What three changes allow the class to be used with generics and avoid an unchecked warning? (Choose three.)  
 1. Remove line 14. 
 2. Replace line 14 with "int i = iter.next();". 
 3. Replace line 13 with "for(int i : intList){". 
 4. Replace line 13 with "for(Iterator iter : intList){".  
 5. Replace the method declaration with "sum(List<int> intList)". 
 6. Replace the method declaration with "sum(List<Integer> intList)".
(A) 123
(B) 246
(C) 136
(D) 456
.


29.重新載圖189 
5e4de40f1d354.jpg
What is the result?
(A) Compilation fails due to an error in line 23.
(B) Compilation fails due to an error in line 29.
(C) A ClassCastException occurs in line 29.
(D) A ClassCastException occurs in line 31.
(E) The value of all four objects prints in natural order.
.


30.重新載圖190 
5e4de44588966.jpg
What is the result?
(A) 0
(B) 1
(C) 2
(D) 3
(E) 4 (AB) Compilation fails. (AC) An exception is thrown at runtime.
.


31.重新載圖191 
5e4de4662663d.jpg
Which two, inserted at line 11, will allow the code to compile? (Choose two.)  
 1. public class MinMax<?>{ 
 2. public class MinMax<? extends Number>{ 
 3. public class MinMax<N extends Object>{ 
 4. public class MinMax<N extends Number>{ 
 5. public class MinMax<? extends Object>{ 
 6. public class MinMax<N extends Integer>{
(A) 15
(B) 23
(C) 46
(D) 56
.


32.重新載圖192 
5e4de4c6bcc36.jpg
Which three code fragments, inserted independently at line 6, will compile? (Choose three.)
(A) list.add("foo");
(B) Object o = list;
(C) String s = list.get(0);
(D) list = new ArrayList<String>();
(E) list = new ArrayList<Object>();
.


33.重新載圖193 
5e4de4e6ab753.jpg
What is the result?
(A) apple pear
(B) banana pear
(C) apple apple
(D) apple banana
(E) banana banana
.


34.重新載圖194 
5e4de50c309b7.jpg
Which statement is true?
(A) The expressions (ONE == ONE) and ONE.equals(ONE) are both guaranteed to be true.
(B) The expression (ONE < TWO) is guaranteed to be true and ONE.compareTo(TWO) is guaranteed to be less than one.
(C) The Example values cannot be used in a raw java.util.HashMap; instead, the programmer must use a java.util.EnumMap.
(D) The Example values can be used in a java.util.SortedSet, but the set will NOT be sorted because enumerated types do NOT implement java.lang.Comparable.
.


35.重新載圖195 
5e4de56571cb9.jpg
What is the result?
(A) 2 1 0
(B) 2 1 1
(C) 3 2 1
(D) 3 2 2
(E) Compilation fails. 
(AB) An exception is thrown at runtime.
.


36.重新載圖196 
5e4de5856aa52.jpg
What inserted at line 39, will sort the keys in the props HashMap?
(A) Arrays.sort(s);
(B) s = new TreeSet(s);
(C) Collections.sort(s);
(D) s = new SortedSet(s);
.


37.重新載圖197 
5e4de5a70a4ab.jpg
 What is the result?
(A) A, B, C,
(B) B, C, A,
(C) Compilation fails.
(D) The code runs with no output
(E) An exception is thrown at runtime.
.


38.重新載圖198 
5e4de5c45246c.jpg
What is the result?
(A) 3, 2, 1,
(B) 1, 2, 3,
(C) Compilation fails.
(D) The code runs with no output.
(E) An exception is thrown at runtime.
.


39.重新載圖199 
5e4de5f6e83ac.jpg
What is the result?
(A) The code runs with no output.
(B) An exception is thrown at runtime.
(C) Compilation fails because of an error in line 20.
(D) Compilation fails because of an error in line 21.
(E) Compilation fails because of an error in line 23. 
(AB) Compilation fails because of an error in line 25.
.


40.重新載圖200 
5e4de615a09de.jpg
Which statement is true?
(A) Compilation fails because the hashCode method is not overridden.
(B) A HashSet could contain multiple Person objects with the same name.
(C) All Person objects will have the same hash code because the hashCode method is not overridden.
(D) If a HashSet contains more than one Person object with name="Fred", then removing another Person, also with name="Fred", will remove them all.
.


【非選題】
41.153 Chain these constructors to create objects to read from a file named "in" and to write to a file named "out". 5e4cf53ed03ac.jpg


【非選題】
42.155 The doesFileExist method takes an array of directory names representing a path from the root filesystem and a file name. The method returns true if the file exists, false if it does not. 
Place the code fragments in position to complete this method. 5e4cf5962a847.jpg


【非選題】
43.156 Place the code fragments into position to use a BufferedReader to read in an entire text file. 5e4cf5c237fe3.jpg


【非選題】
44.176 Place the code fragments into position to produce the output: true true false5e4cfb2e771ff.jpg 

【非選題】
45.179 Place the Relations on their corresponding Implementation Structures. Note Not all Implementation Structures will be used.
5e4de1bfcb38e.jpg


【非選題】
46.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.
5e4de1fdef767.jpg
5e4de21f9b2f4.jpg


【非選題】
47.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.
5e4de29c3985e.jpg


【非選題】
48.182 
5e4de2d0cb1a9.jpg
Place the correct Compilation Result on each takeList() method definition to indicate whether or not the go() method would compile given that definition.
5e4de30543f88.jpg


【非選題】
49.183 Place the code in the appropriate places such that this program will always output [1, 2].
5e4de334c62cd.jpg


【非選題】
50.184 Place each Collection Type on the statement to which it applies.
5e4de352bfcb3.jpg


懸賞詳解

國一社會下第一次

重新載圖5. 下方漫畫呈現的內容,最足以形容台灣農業的何種經營特色? (A)單位面積產量低 (B)大量使用肥料 (C)投入的勞力成本偏高 (D)高度機械化耕作 ...

50 x

前往解題

-1910 年 - SCJP 6.0 認證教戰手冊第二版 SCJP 6.0 認證教戰手冊第二版 認證教戰手冊第二版_題庫 151-200#83081-阿摩線上測驗

-1910 年 - SCJP 6.0 認證教戰手冊第二版 SCJP 6.0 認證教戰手冊第二版 認證教戰手冊第二版_題庫 151-200#83081