- Trending Categories
- 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 IsReadOnly property of Hashtable class in C#?
The IsReadOnly property of Hashtable class is used to get a value indicating whether the Hashtable is read-only.
Example
using System; using System.Collections; namespace Demo { class Program { static void Main(string[] args) { Hashtable ht = new Hashtable(); ht.Add("One", "Amit"); ht.Add("Two", "Aman"); ht.Add("Three", "Raman"); Console.WriteLine("IsReadOnly = " + ht.IsReadOnly); Console.ReadKey(); } } }
Output
IsReadOnly = False
Above we have set a Hashtable with three elements.
ht.Add("One", "Amit"); ht.Add("Two", "Aman"); ht.Add("Three", "Raman");
After that, we have checked using the IsReadOnly property.
Console.WriteLine("IsReadOnly = " + ht.IsReadOnly);
Advertisements