We want to index each character in alphabet. So ‘a’ = 0, ‘b’ = 1, ‘c’ = 2, ‘d’ = 3…and so on. With this statement we calculate this index. If charAt(i) is ‘a’ then we will get ‘a’ - ‘a’ = 0. This position is now used in array. If charAt(i) = ‘k’. Then ‘k’ - ‘a’ = 10 We get position 10 of array. Does this clear your doubt?