读文件的两个小题?
33.( )
The file "file.txt" exists on the file system and contains ASCII text.
try{
File f=new File("file.txt");
OutputStream out=new FileOutputStream(f);
}catch (IOException e){}
A. the code does not compile
B. the code runs and no change is made to the file
C. the code runs and sets the length of the file to 0 。
D. An exception is thrown because the file is not closed
E. the code runs and deletes the file from the file system
34.( )
The file “file.txt” exists on the file system and contains ASCII text.
Given:
38. try {
39. File f = new File(“file.txt”);
40. OutputStream out = new FileOutputStream(f, true);
41. }
42. catch (IOException) {}
What is the result?
A. The code does not compile。
B. The code runs and no change is made to the file.
C. The code runs and sets the length of the file to 0.
D. An exception is thrown because the file is not closed.
E. The code runs and deletes the file from the file system.
请帮忙详细解释两道题都是考什么方面的知识的。为什么。
问题点数:0、回复次数:1Top
1 楼kingfish(工作很忙,很少来csdn...)回复于 2005-04-03 16:03:58 得分 0
C
B
构造函数的区别Top




