Thanks for the input, my partner helped me out and I fixed it in the mean time, to fix the problem I had to change the System.out.println to (line.charAt(idx)); instead if just (idx)