Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

what r arraylist?
what the use of Hashtables?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to handle exceptions that are raised in a component?

1087


In a site to turn off cookies for one page which method is followed?

959


Can you pass parameters to destructors?

1053


Can we override interface methods in c#?

867


4. Describe the process when we send a request URL? And who is responsible for that?

1988


Is array passed by reference in c#?

965


What are circular references? How garbage collection deals with circular references.

918


Explain different properties of object oriented systems.

984


Can we change static value in c#?

1059


Is ram a heap?

921


What is array and its types in c#?

935


What is helper method in c#?

925


What are namespaces, and how they are used?

1007


List some of the common data providers for ado.net framework?

855


What is difference between var dynamic and object in c#?

943