Is it correct to use a try catch block when trying to read files? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is it correct to use a try catch block when trying to read files?

10th Jul 2016, 3:31 PM
War Hammer
War Hammer - avatar
3 Answers
+ 1
yes, not only for the case of not existence, but for other file related exceptions.
4th Nov 2016, 7:40 PM
Luis A. Black Silva
0
yes
18th Jul 2016, 10:05 AM
FreakManMega
0
Yes.....In case the file does not exist.
4th Aug 2016, 5:52 PM
Pranav Pratheek
Pranav Pratheek - avatar