C# Exclusive Interview Questions and Answers (453) - Page 22

  • A joint initiative from DotNetFunda.Com and Questpond.
  • A one stop place on the internet to get trusted and proven Interview Questions (based on more than a decade of experience in this field) to ensure the success of the candidates.
  • You will find almost all Interview questions from Questpond here and this list is growing day by day with all latest and updated interview questions.

453 records found.

Get 650+ Questpond's Interview videos on discount

can we have insert method in HashTable

No, because in hash table we do not have index, so we cannot insert in hashtable.
What is the default capacity of an arraylist

Default capacity is 0. When the 1st element is added , the capacity will be 4 . Again when the 5th element is added the capacity will be 8 and so on.
How is dictionary entry added to Hash table

Using "Add(,) " we can add the dictionary entry. For example:


Dim dic As New Dictionary(Of Integer, String)()

dic.Add(105, "Student1")

dic.Add(102, "Student2")

dic.Add(100, "Student3")

dic.Add(104, "Student4")
When do we use HASH TABLE and when we use HASH MAP

Whenthere is necessity store the key value pairs, should go for the
hashtable or hashmap, preferred one is Hashmap as the hashtable is
synchronized. The basic objective is to maintain the pairs. Knowing the key you can iterate through these collections and get the values.
Can we override the ToString() method

Yes,the ToString() method is by default a Virtual method in the Object
class and we can override it and return any other value according to our
requirement.
Is "insertion" and "deletion" possible using Array? What is an alternate solution to this

No,Array does not allow insertion and deletion of items which is possible
using ArrayList which can dynamically grow in size.
When is the object ready for garbage collection?

when all the references to the object are lost
What does IDictionary Interface represent

IDictionary interface represents a non-generic collection of key/value pairs.
The data types to be used in a Generic class are determined at ___________

NOTE: This is objective type question, Please click question title for correct answer.
can we disable connection pooling?

By default it is always enabled.
But if we want to disable explicitly set Pooling=false in your connection string for disabling
connection and enable by setting set Pooling=true
Advantages of Generic Classes are _______________________

1. Type Safety

2. Performance

3. Reusability
Every Collection is implemented from the Interface _______________

Every Collection is implemented from the Interface:IEnumerable.
IEnumerable & IEnumerator have direct relationship?

IEnumerable and IEnumerator doesn't have any direct relationship.
What is the use of destructor in .net?

Destructor of a class is used to destroy COM objects which are created by it in unmanaged heap
When is the class loaded by class loader in CLR

A class is loaded when either the first instance of the class is created
or when the static member of the class is accessed for the first time.
Can we suppress the calling of destructor when the object is garbage collected?

Yes,
System.GC.SuppressFinalize(ob) //ob is reference to object whose
destructor should not be called when the object is Garbage Collected.
Define Object

An object is self describing complete entity. At a glance, one should be
able to describe what is the state of the object, this what the object
can perform and certain things the object cannot perform.

More C# Interview Questions & Answers here

Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Exclusive Interview Questions and Answers Categories