This is a simple code to get the character at the given index within the String. It is going through an infinite loop, I know that adding the scanner.nextLine() in the catch cla