// we create a string composed of 6 jamo
String hangul = "\u1112\u1161\u11ab\u1100\u1173\u11af";
// Retreive a character and a word BreakIterator object
// that is locale-sensitive for Korean text.
BreakIterator ci = BreakIterator.getCharacterInstance(Locale.KOREAN);
BreakIterator wi = BreakIterator.getWordInstance(Locale.KOREAN);
System.out.print("Character Boundaries: ");
printBoundaries(hangul, ci);
System.out.print("\nWord Boundaries:");
printBoundaries(hangul, wi);