CBSE Class 12 Computer Science Question 126 of 136

Data File Handling — Question 14

Back to all questions
14
Question

Question 14

'with' statement ensures that all the resources allocated to the file objects get deallocated automatically.

Answer

True

Reason — The 'with' statement ensures that all resources allocated to file objects are deallocated automatically once we stop using the file. In the case of exceptions also, we are not required to explicitly close the file using the 'with' statement.