class Main {
public static void main(String[] args) {
String s = "abc";
for (char c : s.toCharArray()) {
// a char is a UTF-16 code unit; cast to int for its code
System.out.println(c + " " + (int) c);
}
}
}toCharArray and code points