SCJP 1.6版考題 175

出自 陳富國維基館
於 2013年3月30日 (六) 02:00 由 Ikk (對話 | 貢獻) 所做的修訂 (新頁面: 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 ...)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)
前往: 導覽搜尋
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

解答


Ans: A B

解說:

此題問: 那二個情境在置換StringBuffer物件是不安全的?
 A 使用JDK5.0之前的版本
 B 在多個執行緒之前分享StringBuffer物件