import java.util.Scanner;
public class Inti{
public static void main (String [] args){
Scanner kb = new Scanner(System.in);
System.out.println("enter name: ");
String input = kb.nextLine();
char name1 = input.charAt(0);
int blank = input.indexOf(' '+1);
char name2 = input.charAt(blank);
int lastBlank = input.lastIndexOf(' '+1);
char name3 = input.charAt(lastBlank);
System.out.println(name1 + "\n" + name2 +"\n"+ name3 );
}
}
i keep getting a runtime error. the user is supposed to enter a first, middle, and last name and the program prints out the initials.