how to convert character to string in java code example
Example 1: convert char to string java
char c = 'a';
String s = Character.toString(c);
Example 2: java convert a string to char[]
String string = "ABCDEF" ;
char[] charsFromString = string.toCharArray();
Example 3: convert char to string
char c = 'a';
String s = Character.toString(c);
Example 4: char to string jva
char ch = 'a';
String.valueOf(ch);
Example 5: Converting Char to String in java
class CharToStringDemo
{
public static void main(String args[])
{
char ch = 'a';
String str = Character.toString(ch);
System.out.println("String is: "+str);
String str2 = String.valueOf(ch);
System.out.println("String is: "+str2);
}
}
Example 6: android studio char to string
(char[]).toString();
String MyString = new String(MyChars);