what r arraylist?
what the use of Hashtables?

Answers were Sorted based on User's Feedback



what r arraylist? what the use of Hashtables?..

Answer / prasad

array is a collection of elements of simlar type
hastable is a collection of elements of different types.
we can retrive data from hashtable in key-value pair manner

Is This Answer Correct ?    8 Yes 0 No

what r arraylist? what the use of Hashtables?..

Answer / kautilya

arraylist is a collection of objects of same type. It
implements IList interface. it can grow dynamically, we can
add elements in it at runtime. it should be used when we
dont have information that how many elements will get
stored in it. it also has facility of searching and sorting.


Hashtable is storing data in key-value pair, where key
field will remain unique. Here elements can be searched
using key value. It is serializable.

Is This Answer Correct ?    6 Yes 1 No

what r arraylist? what the use of Hashtables?..

Answer / sharmin jose

Everything told above is correct except that ArrayList can
only contain "similar data type".
Please compile and execute the following code:
using System;
using System.Collections;
public class SamplesArrayList {

public static void Main() {

// Creates and initializes a new ArrayList.
ArrayList MyList = new ArrayList();
MyList.Add("Hello");
MyList.Add("World");
MyList.Add(1);

// Displays the properties and values of the
ArrayList.
Console.WriteLine( "MyList" );
Console.WriteLine( "\tCount: {0}", MyList.Count );
Console.WriteLine( "\tCapacity: {0}",
MyList.Capacity );
Console.Write( "\tValues:" );
PrintValues( MyList );
}

public static void PrintValues( IEnumerable myAL ) {
System.Collections.IEnumerator myEnumerator =
myAL.GetEnumerator();
while ( myEnumerator.MoveNext() )
Console.Write( "\t{0}", myEnumerator.Current );
Console.WriteLine();
}
}

Is This Answer Correct ?    1 Yes 0 No

what r arraylist? what the use of Hashtables?..

Answer / guest

Arraylist is a collection of different datatypes.

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C Sharp Interview Questions

How long can loop recorders stay in?

0 Answers  


What is check/uncheck?

0 Answers  


What does void mean unity?

0 Answers  


write program in c# using this instructions name avinash varma ,work experiance<2,nochildren his work experiance is higher than 5 years,more than one children one children name is diwakar,number of years of work eperiance at current company is the ratio of children and work experiance is 0.21 to 0.5

0 Answers  


7. C# provides a default constructor for me. I write a constructor that takes a string as a parameter, but want to keep the no parameter one. How many constructors should I write?

2 Answers  


What is datareader c#?

0 Answers  


What is the wildcard character in SQL? Let?s say you want to query database with LIKE for all employees whose name starts with La.

1 Answers  


What is difference between iqueryable and ienumerable in c#?

0 Answers  


What are the advantages of interface in c#?

0 Answers  


Can an exception be thrown from a catch block?

0 Answers   Alcatel-Lucent,


Explain deadlock?

0 Answers  


Explain boxing and unboxing in c#?

0 Answers  


Categories