BThis is my code:
public static void main(String[] args) { String teacherName = "Benjamin Brown"; int teacherSecondInitialIndex = (teacherName.indexOf(" ") + 1); String teacherInitials = new StringBuilder(teacherName.charAt(0)).append(teacherName.charAt(teacherSecondInitialIndex)).toString(); System.out.println(teacherInitials); } I want to print out the initials of teacherName, which would be "BB". But only "B" is being printed out. What is the issue?