C#中Hashtable类的IsFixedSize属性是什么?
使用Hashtable类的isFixedSize属性获取一个值,该值指示Hashtable是否具有固定大小。
以下是显示如何使用IsFixedSize属性的示例。
示例
using System;
using System.Collections;
namespace Demo {
class Program {
static void Main(string[] args) {
Hashtable ht = new Hashtable();
ht.Add("D01", "Finance");
ht.Add("D02", "HR");
ht.Add("D03", "Operations");
Console.WriteLine("IsFixedSize = " + ht.IsFixedSize);
Console.ReadKey();
}
}
}输出结果
IsFixedSize = False
上面我们添加了Hashtable集合。
Hashtable ht = new Hashtable();
然后,在添加元素之后,我们使用isFixedSize属性检查了它是否具有固定大小。
ht.IsFixedSize
热门推荐
10 毛笔哥哥结婚祝福语简短
11 向国庆送祝福语简短
12 建队节祝福语简短
13 朋友喜得外孙简短祝福语
14 小店营业的祝福语简短
15 餐饮生日祝福语简短独特
16 鲜花英语祝福语卡片简短
17 男朋友暴富祝福语简短
18 婶婶拜年祝福语大全简短