Java tutorial
//package com.java2s; public class Main { private static void checkOffset(String paramString, int paramInt, char paramChar) throws IndexOutOfBoundsException { char c = paramString.charAt(paramInt); if (c != paramChar) throw new IndexOutOfBoundsException("Expected '" + paramChar + "' character but found '" + c + "'"); } }