Java Character toString() Method6 Nov 2024 | 3 min read The toString() method of Character class returns the String object which represents the given Character's value. The obtained result is typically a string with length 1 whose component is a primitive char value that represents the Character object. SyntaxReturn ValueThe toString()method returns the string representation of the given character. Example 1Output: The string value of r is: r The string value of 9 is: 9 Example 2Output: The string value of A is: A The string value of 7 is: 7 Java Character toString(char c)MethodThe toString(char c) method of Character class returns the String object which represents the given Character's value. The obtained result is typically a string with length 1 whose component is a primitive char value that represents the Character object. SyntaxParameterc: It is the character that needs to be tested. Return ValueThe toString(char c) method returns the string representation of the given character. Example 1Output: The string value of V is given as:V The string value of v is given as: v Example 2Output: The string value of f is given as:f The string value of e is given as: e Next TopicJava-character-totitlecase-method |
The getType(char ch) method of Character class returns a value which indicates the general category of the character. This method is not used for the supplementary characters. We can use the getType(int codePoint) method to support all the Unicode characters including the supplementary. Syntax public static int getType(char...
4 min read
The isLowSurrogate(char ch) method of character class determines whether the given(or specified) character is a Unicode low-surrogate code unit (which is also known as trailing-surrogate code unit). These values do not represent the characters by themselves, rather than these values are used to represent the supplementary characters...
5 min read
The hashCode() method of Character class generally returns the hash code for the given character. The result of the given method is similar to the result of invoking the charValue() method. Syntax public int hashCode() Parameter N.A. Return Value The hashCode() method of Character class returns the hash code for the given...
4 min read
The toChars(int codePoint) method of Character class generally converts the specified character into its UTF-16 representation which is usually stored in a char array. If the specified codePoint is a BMP value, the resulting char value array has the same value as the codePoint. On the...
5 min read
The toUpperCase(char ch) method of Character class converts the given character argument to the uppercase using a case mapping information which is provided by the Unicode Data file. It should be noted that Character.isUpperase(Character.UpperCase(ch)) may not always return true for some characters. In actual, the String.toUpperCase() can be...
4 min read
The isHighSurrogate(char ch) method of Character class determines whether the given value is high-surrogate code unit, which is also called a leading surrogate code unit. These values cannot be used to represent the characters by themselves, but they can be used in the representation of supplementary characters...
2 min read
The isJavaIdentifierStart(char ch) method of Character class determines whether the given(or specified) character is considered as the first character in a Java identifier or not. A character may start a Java identifier if and only if any of the following conditions is true: isLetter(ch) returns true. getType(ch) returns LETTER_NUMBER. The...
4 min read
The reverseBytes(char ch) method of Character class returns the values obtained by reversing the bytes in a particular order for a given value. Syntax public static char reverseBytes(char ch) Parameter ch: It is the character that needs to be tested. Return Value The reverseBytes(char ch)method returns the value which is obtained by...
3 min read
class The Character class generally wraps the value of all the primitive type char into an object. Any object of the type Character may contain a single field whose type is char. All the fields, methods, and constructors of the class Character are specified by the...
9 min read
The Character.isTitleCase(char ch) method in Java checks if a given character is a title-case character. Title-case characters are typically used at the start of words in languages where capitalization rules apply. This method returns true if the character isTitleCase(); otherwise, it returns false. It belongs...
8 min read
We request you to subscribe our newsletter for upcoming updates.
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India