I am getting
Exception in thread \"main\" java.lang.ArrayIndexOutOfBoundsException: 0
at com.ibm.icu.text.BreakDictionary.main(BreakDictionary.java:40)
<
You are running the main
method of BreakDictionary
. In other words: you are running a completely different program and not the code you posted.
In order to be sure that you are not running a different method from the dictionary class, you should right click on your class and run it as a Java application.