Exam 13: Working With Files

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

To programmatically avoid having a FileNotFoundException or DirectoryNotFoundException exceptions thrown in an application, you should send the filename as an argument to Exists( ) before attempting to construct an object.

(True/False)
4.7/5
(38)

Which of the following is an abstract class that cannot be instantiated?

(Multiple Choice)
4.8/5
(27)

Which of the following class has public constructors?

(Multiple Choice)
4.7/5
(32)

PadRight( ) and PadLeft( ) methods of the ____________ class can be use to right or left align values.

(Short Answer)
4.7/5
(33)

The constructor for the StreamWriter class is overloaded to include a Boolean variable indicating whether this is the first time the file was accessed.

(True/False)
4.9/5
(43)

StreamReader inFile = new StreamReader("name.txt"); While ((inValue = inFile.ReadLine()) != null) With the above code segment, how could you programmatically avoid having a FileNotFoundException or DirectoryNotFoundException exception thrown?

(Multiple Choice)
4.8/5
(33)

To invoke File's Copy( ) method to make a copy of "source.txt", naming the new file "target.txt", you would write: File.Copy("source.txt", "target.txt"); because Copy is a static member of the File class.

(True/False)
4.8/5
(48)

The files created using the ____________ class are readable by the computer but, unlike the files created by the StreamWriter class, you cannot simply open and read the contents of the file using Notepad. A program is needed to interpret the file contents.

(Short Answer)
4.9/5
(39)

The File, FileInfo, Directory, and DirectoryInfo classes are considered utility classes. They normally work with stream objects, allowing you to manipulate files and directory structures.

(True/False)
4.8/5
(39)

Every member of the File class is static-meaning methods are called ____.

(Multiple Choice)
4.9/5
(36)

The StreamWriter method(s) that clears all buffers for the current writer and causes any buffered data to be written to the underlying stream is ____.

(Multiple Choice)
4.8/5
(43)

FileInfo and DirectoryInfo classes expose only static data members.

(True/False)
4.8/5
(46)

The ____ class has implementations for Write( ) and WriteLine( ) methods similar to the Console class methods.

(Multiple Choice)
4.9/5
(34)

The StreamReader class extends the ____ class.

(Multiple Choice)
4.9/5
(35)

NET Framework includes the ____________ namespace, which provides basic file and  directory support classes. It also contains types that enable you to read and write files and data streams.

(Short Answer)
4.8/5
(48)
Showing 61 - 75 of 75
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)