98-372 · Question #65
Which class is used to provide support in the creation of FileStream objects?
The correct answer is B. FileInfo class. The FileInfo class is an informational class that is used to provide instance methods to create, copy, delete, move, and open files. It is used to provide support in the creation of FileStream objects. Most of the FileInfo methods return other I/O types in case of creating or…
Question
Which class is used to provide support in the creation of FileStream objects?
Options
- AFile class
- BFileInfo class
- CFileShare class
- DFileAccess class
How the community answered
(53 responses)- A4% (2)
- B72% (38)
- C15% (8)
- D9% (5)
Explanation
The FileInfo class is an informational class that is used to provide instance methods to create, copy, delete, move, and open files. It is used to provide support in the creation of FileStream objects. Most of the FileInfo methods return other I/O types in case of creating or opening files. You can use these other types to further manipulate a file. It is better to use the instance method of the FileInfo class when an object is to be reused several times. The methods of the FileInfo class do not require any specified path to the file. Answer: D is incorrect. FileAccess is not a class but an enumeration. It defines constants for read, write, or read/write access to a file. Answer: C is incorrect. FileShare is not a class but an enumeration. It holds constants for controlling the kind of access other FileStream objects can have to the identical file. Answer: C is incorrect. FileShare is not a class but an enumeration. It holds constants for controlling the kind of access other FileStream objects can have to the identical file. Answer: A is incorrect. The File class is an utility class that is used to provide static methods to create, copy, delete, move, and open files. It is used to provide support in the creation of FileStream objects. It can also be used to get and set file attributes or DateTime information related to the creation, access, and writing of a file. It is more efficient to use the methods of the File class when only one task is to be performed. All methods of the File class require a specified path to the file that is to be manipulated.
Topics
Community Discussion
No community discussion yet for this question.