IsReadOnly Property का उपयोग यह Value Get करने के लिए करें जो Indicate करती है कि SortedList Read-Only है या नहीं।
IsReadOnly Property को C# में Implement करने के लिए निम्न Code Run करें।
यहां, हमने पहले SortedList Set की है।
SortedList s = new SortedList();
Elements Add किए।
s.Add("S001", "Jack"); s.Add("S002", "Henry");अब IsReadOnly Check करें।
Console.WriteLine("IsReadOnly = " + s.IsReadOnly);निम्न Complete Code है।
Example
using System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { SortedList s = new SortedList(); s.Add("S001", "Jack"); s.Add("S002", "Henry"); Console.WriteLine("IsReadOnly = " + s.IsReadOnly); } } }Output
IsReadOnly = False