C# and Dot Net Interview Questions V



Which method is actually called ultimately when Console.WriteLine( ) is invoked

AppendFormat() method is called.

 

What happens when you create an arraylist as ArrayList Arr=new ArrayList()

Once it will reach size 16 addding element in the arraylist, it will be automatically double the size.

 

What is the output of Vectors.RemoveAt(1)

Removes the object at position 1

 

GetEnumerator( ) of Ienumerable interface returns

GetEnumerator() returns a reference to System.Collections.Ienumerator class which allows a simple iteration over a collection

 

How do you add objects to hashtable

Actually operator “=” adds an element too.

The following example adds key-value

pair “x”-”value” to Hashatble h:

HashTable h = new HashTable();

h(”x”) = “value”;

 

If A.equals(B) is true then A.getHashcode & B.getHashCode must always return same hash code

The answer is False because it is given that A.equals(B) returns true i.e. objects are equal and now its hashCode is asked which is always independent of the fact that whether objects are equal or not. So, GetHashCode for both of the objects returns different value.

Ans: False

 

 

The assembly class is defined in

System.Reflection

 

What is the first step to do anything with assembly

Load assembly to running process

 

How do you load assembly to running process

Assembly class provides the following methods to load an assembly:

Load

LoadFrom

LoadFile

LoadWithPartialName

LoadModule

 

Assemblies cannot be loaded side by side

This is possible in .net and thats the way DLL hell is said to be eliminated, its clearly evident from the GAC

 

Application Isolation is assured using

ApplicationDomain



Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: