How to convert char to String in Java
Example of converting char to String in Java

/*
* Convert char to String example. Program to convert char
* to String.
*/

public class CharToString {

public static void main(String args[]){

char ch = 'd';

//to convert char to String use static toString method of Character class.
String strCh = Character.toString(ch);

System.out.println("char converted to String: " + strCh);

}

}
Ads by Google


Output
char converted to String: d
String Examples