title: how to convert an Array to a linked list in Java
body: <p>I am a fairly new Java programmer and I am currently learning about converting lists to arrays. The problem that I am having is that when I try to link the list the output I am getting is not the same as what is in the array. The linked list output is all null values while the array has random values as it should. 
  Here is my code: </p>
  
  <pre><code>import java.util.Arrays;
  import java.util.LinkedList;
  import java.util.List;
  
  public class InsertingElements {
      public static void main(String[] args) {
          Integer[] numbers = new Integer[25];
          List&lt;Integer&gt; linkList = new LinkedList&lt;&gt;(Arrays.asList(numbers));
  
          for (int i = 0; i &lt; numbers.length; i++) {
              numbers[i] = (int) (Math.random() * 100 + 1);
          }
  
          System.out.println("Numbers Generated: " + Arrays.toString(numbers));
  
          numbers = linkList.toArray(new Integer[linkList.size()]);
  
          System.out.println("Numbers: ");
          for (Integer number : numbers) {
              System.out.println(number);
          }
      }
  }
  </code></pre>
  
  <p>And here is the output: </p>
  
  <pre><code>Numbers Generated: [92, 61, 25, 8, 48, 80, 85, 89, 53, 18, 48, 38, 48, 
  41, 93, 94, 24, 73, 83, 21, 18, 52, 3, 14, 10]
  Numbers: 
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  null
  </code></pre>