Yes, pretty much. List<T>
is a generic class. It supports storing values of a specific type without casting to or from object
(which would have incurred boxing/unboxing overhead when T
is a value type in the ArrayList
case). ArrayList
simply stores object
references. As a generic collection, List<T>
implements the generic IEnumerable<T>
interface and can be used easily in LINQ (without requiring any Cast
or OfType
call).
ArrayList
belongs to the days that C# didn’t have generics. It’s deprecated in favor of List<T>
. You shouldn’t use ArrayList
in new code that targets .NET >= 2.0 unless you have to interface with an old API that uses it.
Related Posts:
- How to split() a delimited string to a List
- What is a singleton in C#?
- My C# application is returning 0xE0434352 to Windows Task Scheduler but it is not crashing
- How to Sort a List
by a property in the object - C# Set collection?
- foreach vs someList.ForEach(){}
- Why is Dictionary preferred over Hashtable in C#?
- Does anyone still use [goto] in C# and if so why?
- How does the “Using” statement translate from C# to VB?
- What is the best way to parse html in C#? [closed]
- Best C# API to create PDF
- C# cannot convert method to non delegate type
- What is the difference between const and readonly in C#?
- Merge two (or more) lists into one, in C# .NET
- Pass Method as Parameter using C#
- HashSet vs. List performance
- What’s the @ in front of a string in C#?
- How to solve ‘…is a ‘type’, which is not valid in the given context’? (C#)
- Calling the base constructor in C#
- Best way to repeat a character in C#
- How to empty a list in C#?
- How to open an Excel file in C#?
- What is a method group in C#?
- Remove duplicates from a List
in C# - How do I save a stream to a file in C#?
- Print Pdf in C#
- Can a Byte[] Array be written to a file in C#?
- How do I clone a generic list in C#?
- What is the difference between String and string in C#?
- Creating a List of Lists in C#
- C# int to byte[]
- .Net 4.8 Support for Windows 10 ends in 26 days?
- What is a NullReferenceException, and how do I fix it?
- How to avoid “ConcurrentModificationException” while removing elements from `ArrayList` while iterating it? [duplicate]
- How can I convert String to Int?
- Convert list to array in Java [duplicate]
- What’s the difference between .NET Core, .NET Framework, and Xamarin?
- IOException: The process cannot access the file ‘file path’ because it is being used by another process
- No connection could be made because the target machine actively refused it?
- What does a lock statement do under the hood?
- Could not load file or assembly or one of its dependencies
- What is the purpose of nameof?
- Where/how can I download (and install) the Microsoft.Jet.OLEDB.4.0 for Windows 8, 64 bit?
- Convert Enum to String
- Windows .NET API / Windows 7 / Bluetooth communication with Intel Curie Arduino / Genuino 101
- Error 1053 the service did not respond to the start or control request in a timely fashion
- Windows Application has stopped working :: Event Name CLR20r3
- Access to the path is denied
- Extension methods must be defined in a non-generic static class
- Metadata file ‘.dll’ could not be found
- C# List
to string with delimiter - Convert a list of strings to a single string
- “Error while trying to run project: Unable to start program”. Can run program only once. Then VS needs restart
- How to resolve this System.IO.FileNotFoundException
- What’s the difference between struct and class in .NET?
- Associating enums with strings in C#
- How do I declare a DefaultValue attribute whose value is an array of strings?
- Extension methods must be defined in a non-generic static class
- “An attempt was made to load a program with an incorrect format” even when the platforms are the same
- Create a List of primitive int?
- Select distinct using linq
- Invalid URI: The format of the URI could not be determined
- Multiple file-extensions searchPattern for System.IO.Directory.GetFiles
- Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction
- Unable to read data from the transport connection : An existing connection was forcibly closed by the remote host
- Why did I get the compile error “Use of unassigned local variable”?
- Reading CSV file and storing values into an array
- The remote server returned an error: (407) Proxy Authentication Required
- Cannot access a disposed object – How to fix?
- Deep cloning objects
- Regular expression “^[a-zA-Z]” or “[^a-zA-Z]”
- finding the maximum length of lists in c#
- .NET graph library around?
- How to solve “Could not establish trust relationship for the SSL/TLS secure channel with authority”
- XmlSerializer – There was an error reflecting type
- Run Command Prompt Commands
- SQLite equivalent to ISNULL(), NVL(), IFNULL() or COALESCE()
- Could not establish secure channel for SSL/TLS with authority ‘*’
- windows could not start service on local computer error 5 access is denied
- Visual Studio keeps crashing
- How can I implement static methods on an interface?
- How to add List<> to a List<> in asp.net [duplicate]
- How do I exit a WPF application programmatically?
- .NET String.Format() to add commas in thousands place for a number
- Linq select objects in list where exists IN (A,B,C)
- What is a quick way to force CRLF in C# / .NET?
- How to enable assembly bind failure logging (Fusion) in .NET
- How to make inline functions in C#
- C# Convert List
to Dictionary - .NET Framework 4.6 or a later update is already installed on this computer
- How to create a new object instance from a Type
- Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154
- convert string to arraylist
in java - When should I use a List vs a LinkedList
- What is a “first chance exception”?
- .NET Core vs Mono
- How Do I Implement an Insertion Sort Method for A Generic ArrayList?
- Iif equivalent in C#
- A certificate chain could not be built to a trusted root authority
- How to enumerate an enum