- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- java.lang.IndexOutOfBoundsException
- java.lang.StringIndexOutOfBoundsException
- if index in the string is passing greater then the string size
or negative value of index in string. - class Example {
- public static void main(String[] args) {
- String str = "hello my friends";
- String str1 = str.substring(20);
- }
- }
- Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String ind
- ex out of range: -4
- at java.lang.String.substring(String.java:1937)
- at java.lang.String.substring(String.java:1904)
- at Example.main(Example.java:9)
- if index in the string is passing greater then the string size
Saturday, 12 April 2014
Class StringIndexOutOfBoundsException
Subscribe to:
Post Comments (Atom)
Blog Archive
-
▼
2014
(35)
-
▼
April
(30)
- collections---------------treeset----------------c...
- collections-------Set----------------TreeSet
- Collection-----------Set----------HashSet
- Collections----------->>>>>>>>>Stack
- collections-------------->>>>>>>>>>>Linkedlist
- collections---------->>>>>>>>>>>>Vectro Class-----...
- Array List Method------------->>>>>>>>>>>clone()
- Collections------------->>>>>>>>>>>List---------->...
- Setting Path in JDK
- java-tutorial
- CustomException Throws
- Custom Exception
- Throwing Exceptions
- Class StringIndexOutOfBoundsException
- Class ArrayIndexOutOfBoundsException
- Class Cast Exception
- NumberformatExceptionDemo
- Exception Handling Multiple catch Blocks
- Errors
- click here to download java http://www.oracle.com...
- CODING STANDARDS?
- Difference between StringBuffer && StringBuilder c...
- difference between equals&& = = operator ?
- Difference between Concat And Append methods
- Difference between String class StringBuffer class
- StringBuffer Methods
- StringBufferMethods
- Final Method
- Static method concept breaks overridding cocept
- OverriddingDemo
-
▼
April
(30)
No comments:
Post a Comment