Question 19 of 200.0 5.0 PointsSelect a collection type that match all condition bellow : it is implemented as a circular buffer. It follows LIFO (last in first out ) system. it is a weakly typed collection. Push method allows you to add items to it Peek method just gets the last object of it Pop method also get the last object and then removes that item from it A. Stack Class B. Queue Class C. HashTable Class D. Array class Question 20 of 200.0 5.0 PointsSelect a collection type that match all condition bellow : It is useful for storing messages in the order they were received for sequential processing. it maintains FIFO (first in first out) system. With it you can create weakly typed collections that are ordered by the order they are added to the collection. It accepts a null reference as a valid value and allows duplicate elements. Objects stored in it are inserted at one end and removed from the other. A. Queue Class B. Array class C. Stack Class D. HashTable Class
Trang 1Part 1 of 2 - Part 1 65.0/ 75.0 Points
Trang 2A Finally block is used to enclose code that needs to run, regardless of whether an exception is raised
B Finally block is executed only when no error occurs
C Finally block will be executed only if an error occurs
D Finally block is executed after Catch block when no error occurs
Trang 3What will be the output of above code when compiled / run?
A The output of above code will be
Trang 6A Throwing exceptions is expensive Do not use exceptions to control application flow If you can
reasonably expect a sequence of events to happen in the normal course of running code, you probablyshould not throw any exceptions in that scenario
B You should never catch System.Exception or System.SystemException in a catch block because you could inadvertently hide run-time problems like Out Of Memory
C Do not catch exceptions that you do not know how to handle and then fail to propagate the exception
Trang 7Question 9 of 20 5.0/ 5.0 PointsWhat wrong with these code :
What wrong with this code
static void ProductExists( string ProductId)
{ // search for Product
if ( dr.Read(ProductId) ==0 )
// no record found, ask to create
Trang 8C Throwing exceptions is expensive Do not use exceptions to control application flow If you can
reasonably expect a sequence of events to happen in the normal course of running code, you probablyshould not throw any exceptions in that scenario
Trang 10A catch clause may catch exception of which type?
A The Error Type
B The Exception Type
C The Throwable Type
Exception objects are derived from the class
Trang 12Part 2 of 2 - Part 2 20.0/ 25.0 Points
Select a collection type that match all condition bellow :
Represents a collection of key/value pairs that are organized based on the hash code of the key
A weakly typed collection of key-value pairs
Lets you quickly get an object out of the collection by using it's key
Access items in your weakly typed collection, based on a key, not on an index
Each element is a key/value pair stored in a DictionaryEntry object
A HashTable Class
Trang 13B Queue Class
C Stack Class
D Array class
Select a collection type that match all condition bellow :
It is One of the most basic collection classes
It's not really a collection class, due to its limitations and its not even located in the System.Collections namespace, but in the System namespace
It has a fixed size
it can have multiple dimensions
You can access an item of it by it's index
A Array class
B HashTable Class
C Queue Class
Trang 14D Stack Class
Select a collection type that match all condition bellow :
A SortedList object internally maintains two arrays to store the elements of the list; that is, one array for the keys and another array for the associated values
Each element is a key/value pair that can be accessed as a DictionaryEntry object
A key cannot be a null reference, but a value can be
The elements of a SortedList object are sorted by the keys
In either case, a SortedList does not allow duplicate keys
When an element is added, it is inserted into SortedList in the correct sort order, and the indexing adjusts accordingly
Trang 15How can you sort the elements of the array in descending order?
A By calling Sort() and then Reverse() methods
Trang 16A Finally block is used to enclose code that needs to run, regardless of whether an exception is raised
Trang 17B Finally block is executed only when no error occurs
C Finally block will be executed only if an error occurs
D Finally block is executed after Catch block when no error occurs
What will be the output of above code when compiled / run?
A The output of above code will be
99953
1.3433E+35
B The output of above code will be
99953
Trang 20C Do Not Catch Exceptions That You Cannot Handle
Trang 21}
A Throwing exceptions is expensive Do not use exceptions to control application flow If you can
reasonably expect a sequence of events to happen in the normal course of running code, you probablyshould not throw any exceptions in that scenario
B You should never catch System.Exception or System.SystemException in a catch block because you could inadvertently hide run-time problems like Out Of Memory
C Do not catch exceptions that you do not know how to handle and then fail to propagate the exception
Trang 22B This code is not good, you should Use validation code to avoid unnecessary exceptions
C no thing wrong!
D Do Not Catch Exceptions That You Cannot Handle
What wrong with this code
static void ProductExists( string ProductId)
{ // search for Product
Trang 23C Throwing exceptions is expensive Do not use exceptions to control application flow If you can
reasonably expect a sequence of events to happen in the normal course of running code, you probablyshould not throw any exceptions in that scenario
Trang 24A Try
B Exception
C Catch
D finally
Trang 25Question 13 of 20 5.0/ 5.0 Points
A catch clause may catch exception of which type?
A The Error Type
B The Exception Type
C The Throwable Type
Trang 26Select a collection type that match all condition bellow :
It is One of the most basic collection classes
It's not really a collection class, due to its limitations and its not even located in the System.Collections namespace, but in the System namespace
It has a fixed size
it can have multiple dimensions
You can access an item of it by it's index
Trang 28Question 18 of 20 5.0/ 5.0 PointsSelect a collection type that match all condition bellow :
Represents a collection of key/value pairs that are organized based on the hash code of the key
A weakly typed collection of key-value pairs
Lets you quickly get an object out of the collection by using it's key
Access items in your weakly typed collection, based on a key, not on an index
Each element is a key/value pair stored in a DictionaryEntry object
Select a collection type that match all condition bellow :
it is implemented as a circular buffer
It follows LIFO (last in first out ) system
it is a weakly typed collection
Push method allows you to add items to it
Peek method just gets the last object of it
Trang 29Pop method also get the last object and then removes that item from it
Select a collection type that match all condition bellow :
It is useful for storing messages in the order they were received for sequential processing
it maintains FIFO (first in first out) system
With it you can create weakly typed collections that are ordered by the order they are added to the collection
It accepts a null reference as a valid value and allows duplicate elements
Objects stored in it are inserted at one end and removed from the other
A Queue Class
B Array class
Trang 31A Finally block is used to enclose code that needs to run, regardless of whether an exception is raised
B Finally block is executed only when no error occurs
C Finally block will be executed only if an error occurs
Trang 32D Finally block is executed after Catch block when no error occurs
What will be the output of above code when compiled / run?
A The output of above code will be
Trang 33Question 5 of 20 5.0/ 5.0 PointsWhat is the output ? :
Trang 35A Throwing exceptions is expensive Do not use exceptions to control application flow If you can
reasonably expect a sequence of events to happen in the normal course of running code, you probablyshould not throw any exceptions in that scenario
B You should never catch System.Exception or System.SystemException in a catch block because you could inadvertently hide run-time problems like Out Of Memory
Trang 36C Do not catch exceptions that you do not know how to handle and then fail to propagate the exception
Trang 37Question 10 of 20 0.0/ 5.0 PointsWhat wrong with this code
static void ProductExists( string ProductId)
{ // search for Product
C Throwing exceptions is expensive Do not use exceptions to control application flow If you can
reasonably expect a sequence of events to happen in the normal course of running code, you probablyshould not throw any exceptions in that scenario
Trang 39_ block is executed after try block regardless of the occurrence of error _ block contains all cleanup codes For example, if there is no need of open connection to the database after try block we can write code for connection close in _ block
A catch clause may catch exception of which type?
A The Error Type
B The Exception Type
C The Throwable Type
Trang 40Question 14 of 20 5.0/ 5.0 PointsException objects are derived from the class
Trang 41D Try
Select a collection type that match all condition bellow :
It is One of the most basic collection classes
It's not really a collection class, due to its limitations and its not even located in the System.Collections namespace, but in the System namespace
It has a fixed size
it can have multiple dimensions
You can access an item of it by it's index
Trang 42A SortedList object internally maintains two arrays to store the elements of the list; that is, one array for the keys and another array for the associated values
Each element is a key/value pair that can be accessed as a DictionaryEntry object
A key cannot be a null reference, but a value can be
The elements of a SortedList object are sorted by the keys
In either case, a SortedList does not allow duplicate keys
When an element is added, it is inserted into SortedList in the correct sort order, and the indexing adjusts accordingly
Select a collection type that match all condition bellow :
it is implemented as a circular buffer
It follows LIFO (last in first out ) system
it is a weakly typed collection
Push method allows you to add items to it
Trang 43Peek method just gets the last object of it
Pop method also get the last object and then removes that item from it
Trang 44D Arraytosort.Array.Sort()
Select a collection type that match all condition bellow :
It is useful for storing messages in the order they were received for sequential processing
it maintains FIFO (first in first out) system
With it you can create weakly typed collections that are ordered by the order they are added to the collection
It accepts a null reference as a valid value and allows duplicate elements
Objects stored in it are inserted at one end and removed from the other
A Queue Class
B Array class
C Stack Class
D HashTable Class