Dasaradhi Nidumolu

Greenhorn
+ Follow
since Feb 07, 2013
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dasaradhi Nidumolu

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

The answer is given as A. Will you please explain why not B?
11 years ago