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
Very Simple Exception Handle Program in Java
Alagunila Meganathan
Aug 10
2016
Code
813
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
exceptionHandle.rar
import
java.io.*;
public
class
exceptionHandle{
public
static
void
main(String[] args)
throws
Exception{
try
{
int
a,b;
BufferedReader in =
new
BufferedReader(
new
InputStreamReader(System.in));
a = Integer.parseInt(in.readLine());
b = Integer.parseInt(in.readLine());
}
catch
(NumberFormatException ex){
System.out.println(ex.getMessage() +
" is not a numeric value."
);
System.exit(
0
);
}
}
}
java
Exception Handle