![Trending Articles on Technical and Non Technical topics](/images/trending_categories.jpeg)
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What is the IsFixedSize property of SortedList class in C#?
Use the IsFixedSize property in C# to get a value indicating whether the SortedList has a fixed size.
The following is an example showing SorteList with the usage of IsFixedSize property.
Example
using System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { SortedList s = new SortedList(); s.Add("S1", "Maths"); s.Add("S2", "Science"); s.Add("S3", "English"); s.Add("S4", "Economics"); Console.WriteLine("IsFixedSize = " + s.IsFixedSize); } } }
Output
IsFixedSize = False
We have added a SortedList first and then used the Add() method to set the elements with key and value pair.
SortedList s = new SortedList(); s.Add("S1", "Maths"); s.Add("S2", "Science"); s.Add("S3", "English"); s.Add("S4", "Economics");
Now we have used the IsFixedSize above to check whether the size of the SortedList is fixed or not.
Advertisements