This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
You will get that error if you're using the charAt() method and other methods. According to java.sun.com's API documentation you get that error when:
public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException Thrown by the charAt method in class String and by other String methods to indicate that an index is either negative or greater than or equal to the size of the string.
The above code will generate the StringIndexOutOfBounds exception because there isn't 100 characters in string test. Jax