Madhuri Vijayasri Gurram

Greenhorn
+ Follow
since Oct 22, 2021
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Madhuri Vijayasri Gurram

Generally, the ultimate goal of a programmer is to get correct output for the programs.

Just take a programming language like c, there is no concept of Exception Handling. So there may be chance of wrong output or abnormal termination of our program. And  there is another thing to remind is when our program terminates abnormally , the task is to find where we did the mistake in the program. This makes overhead.

But in Java programming language, there is a concept of Exception Handling. And java provides some built-in classes for Exceptions where different types of possible exceptions are defined. So it makes our programming easy also. By using this concept the programmer can make use of try and catch blocks to handle the abnormal termination of our program and also it is very easy to identify the mistake we did in the program by using this exception classes.

Many programmers use Exception handling(try, catch) for validating keyboard inputs. we can also validate the inputs without try, catch blocks. But as I mention earlier Java provides built-in classes for exceptions where different types of exceptions are defined, we can make use of them instead of writing validation code for keyboard inputs. It is easy to use try and catch blocks instead of writing extra code for validation.  In simple programs it may be easy to write code for validating keyboard inputs, but in complex applications it may be hard to handle such situations. So we can make use of the exception handling concept which is provided in java language.
2 years ago