I making a hashtable(not really important I think), I wanna print out all my elements from my variabel linked list, the insertionOrder(it holds strings, but doesn't matter), I have to do like this, in my method i want to return insertionOrder, but not sure how to do that so the method get all the elements, and in my class Program I wanna print out the insertionOrder, I can't find a solution, thanks! Why I have to do like this? my teacher want it like this. I just wonder if you know a solution. Thanks!
class Hashtable
{
private LinkedList<object> insertionOrder = new LinkedList<object>();
.
.
public LinkedList<object> GetInsertionOrder()
{
return insertionOrder;
}
}
class Program
{
static void Main(string[] args)
{
Hashtable hT= new Hashtable(8);
Console.Writeline("The elements: " + hT.insertionOrder());
}
}