下面居然没错,ArrayList可以添加任何类型的对象?还是说没错只是个巧合
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Collections;namespace Csharp
{
class People
{
public void DoSomething()
{
Console.WriteLine("People::DoSomething()");
}
}
class Program
{
static void Main(string[] args)
{
ArrayList array = new ArrayList();
array.Add(new People());
array.Add(new People());
array.Add(new int());
Console.WriteLine(array.Count);
Console.ReadKey();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Collections;namespace Csharp
{
class People
{
public void DoSomething()
{
Console.WriteLine("People::DoSomething()");
}
}
class Program
{
static void Main(string[] args)
{
ArrayList array = new ArrayList();
array.Add(new People());
array.Add(new People());
array.Add(new int());
Console.WriteLine(array.Count);
Console.ReadKey();
}
}
}
解决方案 »
- 替换DataGridView中DataGridViewLinkColumn的值
- 用C# 与俄罗斯方块
- 求源码
- Linq 问题
- 【求助】!!datagridview中的dt 怎么把它变成一个数据集!
- 求教高手,我刚学C#,有段代码看不懂。请教
- C#程序在WIN2000下出现“找不到程序入口XXXXXX于动态连接库KERNEL32.DLL中”的问题。
- 一个很简单的问题,WINFORM里,我要弹出一个对话框信息,该怎么用~
- 如何将colorDialog.color转换为一个数值型
- c#中在哪个位置定义的变量是全局变量啊?也就是在整个FORM都能有的.
- log4net 按日期分割log 能不能再按一天里的文件大小分割呢?
- 为何可以安全打印 null
ArrayList:
public virtual int Add (
Object value
)
可以添加任何类型对象