TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Java - StringOutOfBoundsException
Senthilvelan Sambamoorthy
Aug 20
2016
Code
708
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
StrEx.rar
// StringIndexOutOfBoundsException
class
StrEx
{
public
static
void
main(String args[])
{
try
{
String str=
"Senthilvelan"
;
System.out.println(str.length());;
char
c = str.charAt(
0
);
c = str.charAt(
20
);
System.out.println(
"\n"
+c);
}
catch
(StringIndexOutOfBoundsException e)
{
System.out.println(
"\nStringIndexOutOfBoundsException : less than of the given String"
);
}
}
}
Java
StringOutOfBoundsException