TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Maha
NA
0
324.6k
ArrayList in C#
Jun 29 2007 6:07 PM
June 29, 2007
Hi Guys
I got the following program from a website. Website address is given below. I wish to know what else can be used to replace the "Add" word. Please help me.
myAL.Add("Hello");
myAL.Add("World");
myAL.Add("!");
Thank you
//http://msdn2.microsoft.com/en-us/library/system.collections.arraylist.aspx
using
System;
using
System.Collections;
public
class
SamplesArrayList
{
public
static
void
Main()
{
// Creates and initializes a new ArrayList.
ArrayList myAL =
new
ArrayList();
myAL.Add("Hello");
myAL.Add("World");
myAL.Add("!");
// Displays the properties and values of the ArrayList.
Console.WriteLine( "myAL" );
Console.WriteLine( "
Count:
{0}", myAL.Count );
Console.WriteLine( "
Capacity: {0}", myAL.Capacity );
Console.Write( "
Values:" );
PrintValues( myAL );
}
public
static
void
PrintValues( IEnumerable myList )
{
foreach
( Object obj
in
myList )
Console.Write( "
{0}", obj );
Console.WriteLine();
}
}
Reply
Answers (
4
)
Resize Mulit-dimensional array
how write xml log file