Dùng IsFixedSize property của Hashtable để kiểm tra có fixed size hay không.
Ví dụ
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();
}
}
}
Kết quả
IsFixedSize = False
Hashtable mặc định không fixed size.