answer action

Can’t find an answer?

Make use of a qualified tutor to get the answer

Irene
42
Q:

Java : convert char to string java

Features

Java
char c = 'a';
String s = Character.toString(c);
//s == "a"
10
String string =  "ABCDEF" ;
 
char[] charsFromString = string.toCharArray(); // { 'A', 'B', 'C', 'D', 'E', 'F' }
7
char c = 'a';
String s = Character.toString(c);
1
from character to string: 
	char c = 'a';
	String s = Character.toString(c);
	//s == "a"
0
char[] chars = { 'A', 'B', 'C', 'D', 'E', 'F' };

String str1 = String.valueOf(chars); //"ABCDEF"
String str2 = new String(chars);// "ABCDEF"

System.out.println(str1.equals(str2)); //"true"
0
char ch = 'a';
String.valueOf(ch);
0
Your Answer

Tags

New to Communities?

Join the community