+ 1
In java how we can parse the character??
as we know to parse integer using we do lets suppose integer i ; so we do i = next.Int(system.in) ,what we do in case of character??
1 Antwort
+ 5
You can use the String method toCharArray:
String str = "test";
char[] c = str.toCharArray();
Or charAt for only one char, here first char of the String:
char c = str.charAt(0);