VOOZH about

URL: https://www.geeksforgeeks.org/java/how-to-convert-char-to-string-in-java/

⇱ How to Convert Char to String in Java? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

How to Convert Char to String in Java?

Last Updated : 23 Jul, 2025

In this article, we will learn how to Convert Char to String in Java. If we have a char value like 'G' and we want to convert it into an equivalent String like "G" then we can do this by using any of the following three listed methods in Java.

  1. Using toString() method of Character class
  2. Using valueOf() method of the String class
  3. Using concatenation of strings

Example of Conversion of Char to String Java

Input : 'G' // Character
Output : "G" // String

Methods to Convert Char to String

Let's discuss three methods in detail for Convert Char to String in Java:

1. Using Character.toString() Method

We can convert a char to a string object in Java by using the  Character.toString() method of Character class.

Below is the Java implementation of the above method:


Output
Char to String using Character.toString method : G

2. Using valueOf() method

We can convert a char to a string object in Java by using String.valueOf() method of String Class.

Below is the java implementation of the above method:


Output
Char to String using String.valueOf() method : G

3. Java char to String Example: Using Concatenation of Strings

We can convert a char to a string object in Java by concatenating the given character with an empty String.

Below is the java implementation of the above appraoch:


Output
Char to String using Concatenation : G

Java char to String: Other Examples

a) Using Character Wrapper Class for Char to String Conversion

We can convert a char to a string object in Java by using java.lang.Character class, which is a wrapper for the char primitive type.

Note: This method may arise a warning due to the new keyword as Character(char) in Character has been deprecated and marked for removal.

Below is the implementation of the above method:


Output
Char to String using Character.toString method : G

Output:

👁 Output for Program to Convert Char to String Java
Command Prompt


b) Using @deprecated annotation with Character.toString().

This will help you to avoid warnings and let you use deprecated methods. This will help you remove the warnings as mentioned in Method 3

Below is the implementation of the above method:


Output
Char to String using @Deprecated Annotation and toString method : G

c) Using the String.valueOf() method of the String class

We can convert a char to a string object in Java by using String.valueOf(char[]) method.

Below is the implementation of the above method:


Output
Char to String using String.valueOf(new char[]) method : G

Comment