SCJP 1.6版考題 194

出自 陳富國維基館
於 2013年3月30日 (六) 00:20 由 Ikk (對話 | 貢獻) 所做的修訂 (新頁面: Given: enum Example{ONE, TWO, THREE} Which statement is true? A. The expressions (ONE == ONE) and ONE.equals(ONE) are both guaranteed to be true. B. The expression (ONE < TWO)...)
(差異) ←上個修訂 | 最新修訂 (差異) | 下個修訂→ (差異)
前往: 導覽搜尋
Given:
enum Example{ONE, TWO, THREE}

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 javautil.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.


解答


Ans: A

解說: The expressions (ONE == ONE) and ONE.equals(ONE) are both guaranteed to be true.