To convert
String
to char
in Java, do this: string.charAt(0)
.Here's how you do it:
String string = "A";
char charFromString = string.charAt(0);
System.out.println(charFromString); // A
String
to char
in Java, do this: string.charAt(0)
.Here's how you do it:
String string = "A";
char charFromString = string.charAt(0);
System.out.println(charFromString); // A