how to print letter in a string 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)));