title: How to pass a linked list as argument into a method and how to call it?
body: <pre><code>class Program
  {
  
      public string name;
      public string cell;
      public Program(string a1,string c1)
      {
          name = a1;
          cell = c1;
      }
  
      public void DetailAccept()
      {
          Console.WriteLine("enter name :");
          name = Console.ReadLine();
          Console.WriteLine("enter cell :");
          cell = Console.ReadLine();
      }
  
      public string getName()
      { 
       return name;
      }
      public string getCellNo()
      { return cell; }
      public void AddL(string a, string b, LinkedList&lt;Program&gt; linked)
      {
          Program p1 = new Program(a, b);
          linked.AddLast(p1);
      }
  
      public void menu()
      {
          Console.WriteLine("\n Choose what to do :\n1. Add new Entry\n2. Search Phone\n3.quit\n");
  
          int choice = Convert.ToInt16(Console.ReadLine());
          switch(choice)
          {
              case 1: DetailAccept();
                  AddL(getName(), getCellNo(), linked); // here is the problem . 
  
          }
      }
  }
  </code></pre>
  
  <p>Do I need to pass the <code>LinkedList</code> as argument to use it in a function?  If yes then how, if no, what are the alternatives? </p>