Computer >> Hướng Dẫn Máy Tính >  >> Lập Trình >> C#

Thuộc tính IsFixedSize của Hashtable trong C#

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.