Hashtable:
- Key/Value combination. (Keys are user defined)
- Variable length
- Type independent
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Collections;
- namespace hashTable
- {
- class Program
- {
- static void Main(string[] args)
- {
- Hashtable ht = new Hashtable();
- ht.Add("Eid",101);
- ht.Add("Ename","Abdullah Al Hasan");
- ht.Add("Email","sujanhasan38@gmail.com");
- ht.Add("Dname","CSE");
- print(ht);
- Console.ReadLine();
- }
- public static void print(Hashtable htable)
- {
- foreach (var i in htable.Keys)
- {
- Console.WriteLine(i+" : "+htable[i]);
- }
- }
- }
- }
0 Comments:
Post a Comment