for(int i=0;i<s1.length();i++)//This line represents loop from 0 to length of s1-1 a[s1.charAt(i)-'a']++;//s1.chatAt(i) returns the character presents at ith index.//s1.chatAt(i)-'a' returns (ASCII value of s1.charAt(i) - ASCII value of 'a')