try catch block is used to avoid termination of program in the runtime
try catch block is mainly used for database application
its nice way to use database application b'coz if any automatic or any runtime error causes termination of a program then there might be chances of crash in the databases
so if any error raised means we can catch in catch block and we can close the database in the catch block
Originally posted by marge
Beginner here with a basic question
When do you use a Try and catch block in a program?Do you have to use try catch to make your pgm look more professional ?