FACULTY OF TECHNOLOGY
Information Technology
01IT0605 – .NET TECHNOLOGY- Lab Manual
Practical 6
6. Create a console application to that implements all collection classes.
Code:
ArrayList:
namespace [Link];
internal class Arraylist1
{
public static void Main()
{
ArrayList student = new ArrayList();
[Link]("jackson");
[Link](5);
for (int i = 0; i < [Link]; i++)
{
[Link](student[i]);
}
[Link]("92210104026 kunjesh_patadiya");
}
}
OUTPUT:
92210104026 6TD2(A) 13
FACULTY OF TECHNOLOGY
Information Technology
01IT0605 – .NET TECHNOLOGY- Lab Manual
Code:
Hashtable:
namespace [Link];
internal class Hashtable1
{
public static void Main()
{
Hashtable mytable = new Hashtable();
[Link]("name","Ginnay");
[Link]("RollNumber", 26);
[Link]("Address", "Rajkot");
[Link](mytable["RollNumber"]);
[Link]("92210104026 Kunjesh_patadiya");
}
}
Output:
92210104026 6TD2(A) 14
FACULTY OF TECHNOLOGY
Information Technology
01IT0605 – .NET TECHNOLOGY- Lab Manual
Code:
Stack:
namespace [Link];
internal class Stack1
{
public static void Main(string[] args)
{
Stack country = new Stack();
[Link]("USA");
[Link]("India");
foreach (String item in country)
{
[Link](item);
}
[Link]("92210104026 Kunjesh_patadiya");
}
}
Output:
92210104026 6TD2(A) 15
FACULTY OF TECHNOLOGY
Information Technology
01IT0605 – .NET TECHNOLOGY- Lab Manual
Code:
Queue:
namespace [Link];
internal class Queue1
{
public static void Main()
{
Queue<string> fruits = new Queue<string>();
[Link]("Mango");
[Link]("Banana");
foreach (String item in fruits)
{
[Link](item);
}
[Link]("92210104026 Kunjesh_Patadiya ");
}
}
OUTPUT:
92210104026 6TD2(A) 16
FACULTY OF TECHNOLOGY
Information Technology
01IT0605 – .NET TECHNOLOGY- Lab Manual
Code:
SortdeList:
namespace [Link];
internal class Queue1
{
public static void Main()
{
SortedList mylist = new SortedList();
[Link](1,"Node JS");
[Link](2,"Express JS");
[Link](3,"React JS");
for (int i = 0; i < [Link]; i++)
{
[Link]("{0}:{1}" ,[Link](i), [Link](i));
}
[Link]("92210104026 Kunjesh_Patadiya”);
}
}
OUTPUT:
92210104026 6TD2(A) 17