I'm not able to declare an ArrayList. Here's my code. (I'd much rather use Lists, but I'm just trying to understand the concept of an ArrayList).
private void button1_Click(object sender, EventArgs e)
{
ArrayList salesTotals = new ArrayList();
decimal[] decimalSales = { 1000m, 2000m, 3000m };
foreach (decimal singleSales in decimalSales)
{
salesTotals.Add(singleSales);
}
}
When I compile this, I get this error:
'ArrayList' is a 'namespace' but is used like a 'type'
I'm using the namespace System.Collections
(not .Generic
)
What is causing this and how do I fix it?