Sunday, 25 March 2012

Test No : 03 - Collections ,Generics , System.IO, Serialisation ,WinForms

.Net Framework and C# Basics - Test No : 01

What’s the .NET collection class that allows an element to be accessed using a unique key?
a) Stack
b) Hashtable
c) Queue
d) Sorted List

Which method is there for quitting a C# .NET application?
a) Appication.Quit()
b) Application.Exit()
c) Application.Close()
d) None of the above

What are collections?
a) A collection is generic group of elements
b) A collection is group of similar type of Elements
c) A collection is a group of dissimilar type of Elements
d) both a and b

An interface used to provide a common way to iterate over a collection
a) IEnumerable
b) IEnumerator
c) IDictionary
d) both a and b

What does the stack clear method do?
a) Clears the information in the objects
b) Removes all objects from the Stack
c) Both a and b
d) none of the above

What does the stack Clone method do?
a) Creates a deep copy of the stack
b) Creates a clean copy of the stack
c) Creates a shallow copy of the stack
d) All of the above
What is queue?
a) FIFO structures
b) FILO Structures
c) LILO Structures
d) none of the above

What is Hashtable?
a) a key-value pair collection class, where Hash codes are objects values
b) a key-value pair collection class, where Hash codes are numbers
c) a key-value pair collection class, where Hash codes are class values
d) a key-value pair collection class, where Hash codes are integer values

Which one of the following is not a queue method?
a) Count
b) Clone
c) Clean
d) Clear

Which method is used to specify the location while adding items to the ArrayList ?
a) Insert
b) LocateAt
c) PlaceAt
d) InsertAt
Which method allows you to add an entire collection of items at a time?
a) AddElements
b) AddRange
c) InsertRange
d) AddLocate

Items are placed into a Stack and items are pulled from the stack using  which methods?
a) pop and peek
b) peek and pop
c) push and peek
d) push and pop

Which method returns the top-most object from the Stack without removing it from the entire collection?
a) pop
b) push
c) peek
d) pull

Which method returns an enumerator for the collection?
a) GetEnumerable
b) GetEnumerator
c) ReturnEnumerator
d) ShowEnumerator

Which method places items in the Queue and which method returns the first-place object in the Queue and removes it from the collection?
a) Prequeue and Dequeue
b) Enqueue and Peekqueue
c) Enqueue and Dequeue
d) None of the above

For a TabControl, which property you can use to add more pages?
a) TabWebPages
b) TabPages
c) TabForms
d) TabWebForms

How can I use a TextBox to enter a password?
a) By Setting its passwordChar property
b) By Setting its PassChar property
c) By Setting its Password property
d) By Setting its Character property

Which one is a type of a stream?
a) Filestream
b) CryptoStream
c) NetworkStream
d) All of the above

Which type of serialization is bulkier than the other two?
a) Binary
b) Soap
c) Http
d) both b and c

What is base namespace for binary serialization?
a) System.Runtime.Serialization.Formatters
b) System.Serialization.Formatters.Binary.Runtime
c) System.Runtime.Binary.Formatters.Serialisation
d) System.Runtime.Serialization.Formatters.Binary

Which attribute needed to apply to a class for making its object serializable?
a) Serialize
b) AttributeSerializable
c) Serializable
d) both a and b

Which class is used to point to a file?
a) StreamRead
b) StreamWriter
c) StreamWrite
d) FileStream

What is the difference between File and FileInfo class?
a) File is a sealed class and FileInfo can be inherited
b) File is a public class and FileInfo is non public
c) File is a static class and FileInfo is non static
d) none of the above

Name which one of the following is not a mode for file opening?
a) Create
b) Open
c) OpenOrCreate
d) CreateOrOpen
Name which one of the following is not a type of access for a file.
a) Read
b) Open
c) Write
d) none of the above

Which is the base namespace for windows forms?
a) System.Windows.UI.Forms
b) System.Windows.Forms.UI
c) System.Forms.Windows
d) System.Windows.Forms

Which is the best ArrayList Method to remove an element at a specific point in the collection?
a) Remove
b) RemoveFrom
c) RemoveAt
d) RemoveSpecific

SortedList does not implement ______________
a) IEnumerator
b) ICollection
c) IDictionary
d) IEnumerable

Generics were introduced in .net framework version no.________________
a) 3.5
b) 2.0
c) 3.0
d) 1.0

 You can use _______to iterate through collections by stepping through each element in turn.
a) only foreach loop
b) only  for  loop
c) Both for and foreach loop
d) do while loop

A collection must implement the  __________________interface.
a) System.Collections.Ienumerator
b) System.Collections.Ienumerable.
d) All of the above

Member a. object Current { get; } b. bool MoveNext(); c. void Reset(); belong to __________ interface.
a) IFormattable
b) IEnumerable
c) IEnumerator
d) IDisposable

 An array list is very similar to an array, except that it has the ability to _______________ and it is represented by class ___________.
a) Move, System.Collections.ArrayList
b) Grow, System.Collections.ArrayList
c) Index, System.Collections.ArrayList
d) All of the above

The _________ method allows you to specify a range of items that are to be removed from a collection of items in the ArrayList
a) RemoveRange()
b) Pop()
c) GetRange()
d) RemoveRange()

A Stack is another collection type that is ideal for working with data items that are considered ________ and are ________ after their use by your application
a) permanent, disposable
b) temporary, disposable
c) temporary, can not be disposed
d) none of the above

________ returns the value of an item at a specified index In sorted list
a) GetByIndex
b) SetByIndex
c) GetRange
d) GetEnumerator

_____________ is great if you want to store objects as if they were an array, but where you want to use some other data type rather than a numeric type to index into the structure
a) Dictonary
b) Sortedlist
c) ArrayList
d) Stack
__________ is an advantage of Generics
a) Performance, Type Safety
b) Binary Code Reuse
c) reuntime errors are reduced
d) All of the above

The interface IComparer<T> is used to sort elements inside a collection with the __________ method
a) Equals()
b) Compare()
c) RefrenceEquals()
d) None of the above

List <T> class implements ____________ interfaces
a) IList<T>
b) IEnumerable<T>
c) ICollection<T>
d) All of the above

The class List<T> is in the namespace _______
a) System.Collections.Generics
b) System.Collections.Generic
c) System.Reflection.Collection.Generic
d) System.Threading.Collections.Generics

_________________ are overloads of Sort method List<T> class
a) Sort(), Sort(Comparison<T>)
b) Sort(Int32, Int32, IComparer<T>)
c) Sort(IComparer<T>),
d) All of the above

With the default keyword _______ is assigned to reference types and _______ is assigned to value types
a) null,  0
b) 0,null
c) 0, value types cant be nul
d) null,value types cant be null

The ________ clause is used to put constraint on generic type
a) order
b) where
d) As

Constructor constraint defines that a ____________ must be available with the generic type
a) parameterised constructor
b) constructor and destructor
c) parameterless constructor
d) ALL of the above

The Nullable<T> properties _______ and ________ can check if there is a value, and the value can be accessed
a) HasValue, Value
b) Hasfile,file
c) HasData, data
d) All of the above

.__________ are generic collection classes
a) List<T>, Dictionary <TKey, TValue>
b) LinkedList<T>, Queue<T>
c) SortedList <TKey, TValue>
d) All of the above

which of the following is not a property of CheckBox control ?
a) Checked
b) CheckAlign
c) CheckOnClick
d) CheckState

which of the following is not a property of ComboBox control ?
a) SelectedItem
b) SelectedIndex
c) SelectedValue
d) SelectedLength
which of the following is wrong example of MDI control ?
a) Notepad
b) MSWord
c) MSAccess
d) MSExcel
Post a Comment