Under the heading 'charAt(), indexOf(), length(), and substring()' it states that:
"These four methods work exactly the same as in the String class.".
However I've noticed from running the subsequent 5 lines of code that indexOf(char ch) does not compile with the StringBuilder class. In other words you can't pass a character as a parameter to 'indexOf), it will only compile, with the StringBuilder class, if you pass it a string.
So, the line:will not compile if it is written as...ie if you substitute the character 'a' for the string "a" in the first occurence of sb.indexOf()