关键字with可以自动管理资源,不论因为什么(哪怕是代码引发了异常)跳出with块,总能保证文件被正确关闭。
A.正确
B.错误
正确答案:A
关键字with可以自动管理资源,不论因为什么(哪怕是代码引发了异常)跳出with块,总能保证文件被正确关闭。
7次阅读
数据库文件、图像文件、可执行文件、动态链接库文件、音频文件、视频文件、Office文档等均属于二进制文件。
当对文件内容操作完以后,一定要关闭文件对象,这样才能保证所做的任何修改都确实被保存到文件中。
猜你喜欢
- A differentiation strategy focuses on providing a product or a service with()attributes, in comparison with the competition, to
- In the case study with Florence, what was the concern she had with her team members?
- The period of()started with the publication of Washington Irving’s The Sketch Book and ended with Walt Whitman’s Leaves of Grass
- 关键字with可以自动管理资源,代码引发了异常也能跳出with块,可以保证文件被正确关闭。
- At the end of the year, he would return to China with happy memories of his experience on Boston and his students there — with a