Java Character toString() MethodThe 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 |
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