Object-Oriented

interview questions of dot net

Posted on

Qu – What are Cascading style sheets?

Cascading style sheets(CSS) collect and organize all of the formatting information applied to HTML elements on a Web form. Because they keep this information in a single location, style sheets make it easy to adjust the appearance of Web applications.

 

Qu – What is the difference between System.String and System.Text.StringBuilder classes?

System.String is immutable.
System.StringBuilder was designed with the purpose of having a mutable string where a variety of operations can be performed.

 

Qu – What are different types of Assemblies?

  • Single file and multi file assembly.
  • Assemblies can be static or dynamic.
  • Private assemblies and shared assemblies.

 

Qu – What is Delegates?

Delegates are a type-safe, object-oriented implementation of function pointers and are used in many situations where a component needs to call back to the component that is using it. Delegates are generally used as basis of events, which allow any delegate to easily be registered for as event.

 

Posted By-: Vissicomp Technology Pvt. Ltd.

Website -: http://www.vissicomp.com

 

 

ArrayList

Posted on

ArrayList:

  • The ArrayList is one of the important classes in the System.Collection namespace.  ArrayList is a dynamic array; it will increase the size of the storage location as required. It stores the value as object. The allocation of the ArrayList can be achieved through the TrimToSize property.
  • In array you can store data only of same data type. For ex-if array has int then char cannot be stored. But this is possible with collection known as hash table.
  • Collections allow easy sorting, deleting and adding of items.
  • Array list work similar to an array.
  • ArrayList has many predefined methods listed below-
Add It will add the element as object in the ArrayList
Clear It will clear the all objects in the ArrayList
Insert It will insert the element in the specified location of the index in the ArrayList.
InsertRange It will insert the elements in the object as individual objects in the specified location.
Remove It will remove the given object in the first occurrence in the ArrayList.
RemoveAt It will remove the object as specified in the argument.
RemoveRange It will remove the set of objects in the ArrayList from the range specified.
Sort It will do the sorting of the elements in the ascending order.
Reverse It will arrange the elements in the reverse order in the ArrayList.
Contains It checks whether the objects exists or not.

 static void Main(string[] args)

{   ArrayList al = new ArrayList();

//adding item to arraylist

al.Add(“ramesh”);

al.Add(“suresh”);

al.Add(“sita”);

al.Add(“gita”);

Console.WriteLine(“add the names to the list”);

foreach (string a in al)

{

Console.WriteLine(“{0}”,a );

}

//sorting item to arraylist

al.Sort();

Console.WriteLine(“sorting names in the list”);

foreach (string a in al)

{

Console.WriteLine(“{0}”, a);

}

//removing item from arraylist

Console.WriteLine(“removing names from the list”);

al.Remove(“ramesh”);

//showing item from arraylist

foreach (string a in al)

{

Console.WriteLine(“{0}”, a);

}

Console.Read();       }    }

 

OUTPUT –

add the names to the list

ramesh

suresh

sita

gita

sorting names in the list

gita

ramesh

sita

suresh

removing names from the list

gita

sita

suresh