boolean () { String str = ""; try { str.charAt(10); return false; } catch (IndexOutOfBoundsException e) { } try { str.substring(10); return false; } catch (IndexOutOfBoundsException e) { } return true; }