Deck 17: Files and Streams

ملء الشاشة (f)
exit full mode
سؤال
The classes dealing with files and directories are located in the System.IO namespace.
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
When a FileStream object is opened,the file-position pointer is _________.

A)set to Null
B) set to 0
C) needs to be explicitly created
D) set to the end of the file
سؤال
What exception is thrown when an error occurs during serialization or deserialization

A) SerialException
B) DeserialException
C) SerializationException
D) DeserializationException
E) c and d, respectively
سؤال
Which of the following methods of FileStream will reset the file-position pointer back to the beginning of the file

A)Reset
B) Origin
C) Seek
D) Beginning
سؤال
An OpenFileDialog allows a user to select a file to open.
سؤال
________ are used for long-term retention of large amounts of data.

A) Memory cards
B) Buffers
C) Files
D) Data structures
سؤال
Each resource should be released as soon as it's no longer needed.
سؤال
Console.In,Console.Out and Console.Error are used to take data in,to display data and to show error messages,respectively.
سؤال
What kind of exception is thrown if there's a problem opening or creating a StreamWriter

A)Exception
B) StreamException
C) OpenAndCreatingException
D) IOException
سؤال
BinaryFormatters can be used to serialize and deserialize objects coming in and going out via a stream.
سؤال
The FileAccess.Read enumeration member is used if the file should not be modified.
سؤال
A _____________ contains the byte number of the next byte in a file to be read or written to a file.

A) data locator
B) file counter
C) file-position pointer
D) byte-number counter.
سؤال
The standard output stream object enables a program to output data to the
screen.
سؤال
A serialized object is an object that includes:

A)a sequence of bytes that contain the object's data
B) information about the object's type
C) information about the types of data stored in the object
D) All of the above
سؤال
Use the _______ method of class OpenFileDialog to show a dialog that allows the user to select a file to be opened.

A) OpenFile
B) ChooseFile
C) ShowDialog
D) OpenFileDialog
سؤال
Data stored in a file is considered:

A) temporary data
B) persistent data
C) recurring data
D) there is no need to store data in files
سؤال
The enumeration FileAccess is used to:

A) control user access to a file
B) control program access to a file
C) control the amount of updating that can be done on a file at once
D) FileAccess is a method, not an enumeration
سؤال
Files can be stored in:

A) hard drives
B) optical disks
C) magnetic tapes
D) All of the above
سؤال
The Console.Error property returns:

A) a standard error stream object
B) a new error
C) an object of type error
D) None of the above
سؤال
When a file is opened,a stream object is created and associated with the file.
سؤال
Method GetFiles of class Directory can be used to display all the files in a given directory.
سؤال
Method ________ of class BinaryFormatter reads a serialized object from a stream and recreates the object in memory.

A) Deserial
B) Deserialize
C) Deserializable
D) DSerial
سؤال
.NET provides class _______ for manipulating files.

A) Folder
B) FileUtil
C) File
D) FileManip
سؤال
Class File can only create new files.
سؤال
Deserialize returns a reference of type:

A) object which must be cast to the appropriate type to manipulate the object
B) the type that the object was originally
C) Deserialized which must be cast to the appropriate type to manipulate the object
D) None of the above
سؤال
For variables of reference types,you must check the class declaration to ensure that the type is serializable.
سؤال
Class Directory is used to change directories.
سؤال
Which of the following attributes is needed to indicate to the CLR that objects of the class can be serialized

A)[Serializable]
B)[DeSerializable]
C)[Serialize]
D)both a and b
سؤال
If the array contains references to other objects,those objects may or may not be serializable.
سؤال
Directory's method GetDirectories returns:

A)a string of all the names of sibling directories
B) an array of strings of all the names of sibling directories
C) a string of all the names of subdirectories
D) an array of strings of all the names of subdirectories
سؤال
BinaryFormatter's Serialize and Deserialize methods are both parameterless.
سؤال
All simple-type variables and strings are serializable.
سؤال
To create a new file and return a stream that can be used to process the file,use the:

A) CreateFile method of class File
B) NewFile method of class File
C) Create method of class File
D) New method of class File
سؤال
A recursive search on a directory is one where:

A) a directory is searched and then all of its sub directories are searched.
B) each sub directory is searched and then the main directory is searched.
C) a search is done randomly on all directories.
D) a and c.
E) a and b
سؤال
By default,array objects are not serializable.
سؤال
In a class that's marked with the [Serializable] attribute or that implements inter
face ISerializable,not every instance variable of the class needs to be seri
alizable.
سؤال
Another way that a class could indicate to the CLR that objects of the class can be serialized is through implementing the ________ interface.

A)Serializable
B)ISerializable
C)Serial
D)Serialize
سؤال
BinaryFormatter allows only for reading objects.
سؤال
The name of the file to open is specified as the first argument to the FileStream constructor.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/39
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 17: Files and Streams
1
The classes dealing with files and directories are located in the System.IO namespace.
True
2
When a FileStream object is opened,the file-position pointer is _________.

A)set to Null
B) set to 0
C) needs to be explicitly created
D) set to the end of the file
B
3
What exception is thrown when an error occurs during serialization or deserialization

A) SerialException
B) DeserialException
C) SerializationException
D) DeserializationException
E) c and d, respectively
C
4
Which of the following methods of FileStream will reset the file-position pointer back to the beginning of the file

A)Reset
B) Origin
C) Seek
D) Beginning
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
5
An OpenFileDialog allows a user to select a file to open.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
6
________ are used for long-term retention of large amounts of data.

A) Memory cards
B) Buffers
C) Files
D) Data structures
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
7
Each resource should be released as soon as it's no longer needed.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
8
Console.In,Console.Out and Console.Error are used to take data in,to display data and to show error messages,respectively.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
9
What kind of exception is thrown if there's a problem opening or creating a StreamWriter

A)Exception
B) StreamException
C) OpenAndCreatingException
D) IOException
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
10
BinaryFormatters can be used to serialize and deserialize objects coming in and going out via a stream.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
11
The FileAccess.Read enumeration member is used if the file should not be modified.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
12
A _____________ contains the byte number of the next byte in a file to be read or written to a file.

A) data locator
B) file counter
C) file-position pointer
D) byte-number counter.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
13
The standard output stream object enables a program to output data to the
screen.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
14
A serialized object is an object that includes:

A)a sequence of bytes that contain the object's data
B) information about the object's type
C) information about the types of data stored in the object
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
15
Use the _______ method of class OpenFileDialog to show a dialog that allows the user to select a file to be opened.

A) OpenFile
B) ChooseFile
C) ShowDialog
D) OpenFileDialog
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
16
Data stored in a file is considered:

A) temporary data
B) persistent data
C) recurring data
D) there is no need to store data in files
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
17
The enumeration FileAccess is used to:

A) control user access to a file
B) control program access to a file
C) control the amount of updating that can be done on a file at once
D) FileAccess is a method, not an enumeration
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
18
Files can be stored in:

A) hard drives
B) optical disks
C) magnetic tapes
D) All of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
19
The Console.Error property returns:

A) a standard error stream object
B) a new error
C) an object of type error
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
20
When a file is opened,a stream object is created and associated with the file.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
21
Method GetFiles of class Directory can be used to display all the files in a given directory.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
22
Method ________ of class BinaryFormatter reads a serialized object from a stream and recreates the object in memory.

A) Deserial
B) Deserialize
C) Deserializable
D) DSerial
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
23
.NET provides class _______ for manipulating files.

A) Folder
B) FileUtil
C) File
D) FileManip
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
24
Class File can only create new files.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
25
Deserialize returns a reference of type:

A) object which must be cast to the appropriate type to manipulate the object
B) the type that the object was originally
C) Deserialized which must be cast to the appropriate type to manipulate the object
D) None of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
26
For variables of reference types,you must check the class declaration to ensure that the type is serializable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
27
Class Directory is used to change directories.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
28
Which of the following attributes is needed to indicate to the CLR that objects of the class can be serialized

A)[Serializable]
B)[DeSerializable]
C)[Serialize]
D)both a and b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
29
If the array contains references to other objects,those objects may or may not be serializable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
30
Directory's method GetDirectories returns:

A)a string of all the names of sibling directories
B) an array of strings of all the names of sibling directories
C) a string of all the names of subdirectories
D) an array of strings of all the names of subdirectories
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
31
BinaryFormatter's Serialize and Deserialize methods are both parameterless.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
32
All simple-type variables and strings are serializable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
33
To create a new file and return a stream that can be used to process the file,use the:

A) CreateFile method of class File
B) NewFile method of class File
C) Create method of class File
D) New method of class File
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
34
A recursive search on a directory is one where:

A) a directory is searched and then all of its sub directories are searched.
B) each sub directory is searched and then the main directory is searched.
C) a search is done randomly on all directories.
D) a and c.
E) a and b
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
35
By default,array objects are not serializable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
36
In a class that's marked with the [Serializable] attribute or that implements inter
face ISerializable,not every instance variable of the class needs to be seri
alizable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
37
Another way that a class could indicate to the CLR that objects of the class can be serialized is through implementing the ________ interface.

A)Serializable
B)ISerializable
C)Serial
D)Serialize
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
38
BinaryFormatter allows only for reading objects.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
39
The name of the file to open is specified as the first argument to the FileStream constructor.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 39 في هذه المجموعة.