how to print a character in java code example
Example 1: print character in string java
String name = "John";
System.out.println(name.charAt(2));
// prints character 'h' to terminal
Example 2: print a letter in java
System.out.println(name.substring(1, Math.min(name.length(), 4)));