Answers for "incompatible types: char cannot be converted to string string ch = str.charat(0);"

2

char cannot be converted to string

//As the compiler said, you can't convert a char to a String. 
//If you have a char and you really want to convert it to a String of length 1, 
//this will work:

String s = String.valueOf(c);
//Or
String s = Character.toString(c);
Posted by: Guest on September-01-2021

Code answers related to "incompatible types: char cannot be converted to string string ch = str.charat(0);"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language