
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
What is the Item property of ArrayList class in C#?
Use the Item property of ArrayList class to get or set the element at the specified index in the ArrayList.
The Item property is an indexer so you can use it without adding the property name.
In the below example, we have used it like the following statement −
Console.WriteLine("Element {0} is \"{1}\"", 2, arrList[1]);
Let us see the complete example tolearn how to work with Item property.
Example
using System; using System.Collections; class Demo { public static void Main() { ArrayList arrList = new ArrayList(); arrList.Add(45); arrList.Add(78); arrList.Add(88); Console.WriteLine("Total elements: "+arrList.Count); Console.WriteLine("Element {0} is \"{1}\"", 2, arrList[1]); } }
Output
Total elements: 3 Element 2 is "78"
- Related Articles
- What is the Count property of ArrayList class in C#?
- What is the IsFixedSize property of ArrayList class in C#?
- What is the IsReadOnly property of ArrayList class in C#?
- What is the Item property of BitArray class in C#?
- What is the Item property of Hashtable class in C#?
- What is the Item property of SortedList class in C#?
- What is the Capacity property of an ArrayList class in C#?
- What is the ArrayList class in C#?
- What is the Capacity property of SortedList class in C#?
- What is the Count property of BitArray class in C#?
- What is the Count property of Hashtable class in C#?
- What is the Count property of Queue class in C#?
- What is the Count property of Stack class in C#?
- What is the Count property of SortedList class in C#?
- What is the Values property of Hashtable class in C#?

Advertisements