Convert a Char to a String in Java
Hassan Saeed
Jan 30, 2023
Sep 22, 2020
-
String.valueOf()
to Convert Char to String in Java -
Character.toString()
to Convert Char to String in Java -
String
Concatenation to Convert Char to String in Java

This tutorial discusses three methods to convert a char to a string in Java.
String.valueOf()
to Convert Char to String in Java
The most efficient way is to use the built-in function of the String
class - String.valueOf(ch)
.
The below example illustrates this:
public class MyClass {
public static void main(String args[]) {
char myChar = 'c';
String charToString = String.valueOf(myChar);
System.out.println(charToString);
}
}
Output:
> c
Character.toString()
to Convert Char to String in Java
We can also use the built-in method of Character
class to convert a character to a String
.
The below example illustrates this:
public class MyClass {
public static void main(String args[]) {
char myChar = 'c';
String charToString = Character.toString(myChar);
System.out.println(charToString);
}
}
Output:
> c
String
Concatenation to Convert Char to String in Java
This method simply concatenates the given character with an empty string to convert it to a String.
The below example illustrates this.
public class MyClass {
public static void main(String args[]) {
char myChar = 'c';
String charToString = myChar + "";
System.out.println(charToString);
}
}
Output:
> c
However, this is the least efficient method of all since the seemingly simple concatenation operation expands to new StringBuilder().append(x).append("").toString();
which is more time consuming than the other methods we discussed.
Related Article - Java String
- Perform String to String Array Conversion in Java
- Remove Substring From String in Java
- Convert Byte Array in Hex String in Java
- Convert Java String Into Byte
- Generate Random String in Java
- The Swap Method in Java
Related Article - Java Char
- Convert Int to Char in Java
- Char vs String in Java
- Initialize Char in Java
- Represent Empty Char in Java
- Char to Uppercase/Lowercase in Java
- Check if a Character Is Alphanumeric in Java