diff options
Diffstat (limited to 'java/lang/Character.java')
| -rw-r--r-- | java/lang/Character.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/java/lang/Character.java b/java/lang/Character.java index 05e641c3a..f87cde62c 100644 --- a/java/lang/Character.java +++ b/java/lang/Character.java @@ -4200,6 +4200,23 @@ public final class Character implements Serializable, Comparable<Character> } /** + * Compares two unboxed char values. + * The result is positive if the first is greater, negative if the second + * is greater, and 0 if the two are equal. + * + * @param x First value to compare. + * @param y Second value to compare. + * + * @return positive int if the first value is greater, negative if the second + * is greater, and 0 if the two are equal. + * @since 1.7 + */ + public static int compare(char x, char y) + { + return Character.valueOf(x).compareTo(Character.valueOf(y)); + } + + /** * Returns an <code>Character</code> object wrapping the value. * In contrast to the <code>Character</code> constructor, this method * will cache some values. It is used by boxing conversion. |
