Answers for "java cast to char"

8

string to char in java

// getting single character from string..
String str="abcd";

char c=str.toChar(0); 

System.out.println("output is "+c); // output is a
Posted by: Guest on May-11-2020
0

java convert a string to char

String string =  "ABCDEF" ;
 
char[] charsFromString = string.toCharArray(); // { 'A', 'B', 'C', 'D', 'E', 'F' }
Posted by: Guest on January-01-1970
5

number to char java

char b = Integer.toString(a);//7-->"7"

char b = (char) b;//65-->"A"
Posted by: Guest on June-29-2020
1

convert from integer to character java

char a = (char) 65;
Posted by: Guest on May-01-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language