what is difference between try and catch block?
Answers
Answered by
1
A try-catch block is an exception handling technique. While a try clause is a precursor to a block, the catch word forms part of a statement.
If you expect a code to throw exceptions, you'd prefer writing the error-prone code inside a try block and expect the associated exception to ‘catch’ it with the catch statement. Something like this snippet:
If you expect a code to throw exceptions, you'd prefer writing the error-prone code inside a try block and expect the associated exception to ‘catch’ it with the catch statement. Something like this snippet:
ashwanimaurya:
thanks where did you live
Similar questions