title: C# nested list storing incorrect values
body: <p>I am struggling with nested list in c#. I am populating a list with Excel data. For this, I store from all data from a column in subdlist2 and then add it to my main list termsList.
  <br>However, at the end when I display the content of my list, values are not those from multiple rows but they are replaced by the values from the last column. Is list content store as reference and not values?
  <br>Example: I have 5 rows, with different values, the fifth one values replace all.</p>
  
  <pre><code>for (i = 0; i &lt; num_speed; i++)
     {
         lastrow_current = GetLastUsedRow(currentWorksheet, 12 + i * 11);
         for (int j = 0; j &lt; lastrow_current; j++)
         {
             if (currentWorksheet.Cells[j + 6, 12 + i * 11].Value != null)
             {
                 if (j == 0)
                 {
                     sublist2.Add(currentWorksheet.Cells[j + 6, 13 + i * 11].Value.ToString());
                 }
                 else
                 {
                 sublist2.Add(currentWorksheet.Cells[j + 6, 13 + i * 11].Value.ToString());
                 }
             }
         }
         termsList.Add(sublist2);
     }
     termsList.Add(sublist2);
     foreach (var sublist3 in termsList)
     {
         foreach (var value in sublist3)
         {
             Console.Write(value);
             Console.Write(' ');
         }
         Console.WriteLine();
     }
  </code></pre>