title: Java: ListA.addAll(ListB) fires NullPointerException?
body: <p>The err part is Capitalized in the code, it also comes in foreaching. Because of the abstract list, it cannot be initialized, declaration is in a static field. The lists have the same type.</p>
  
  <pre><code>import java.util.*;
  
  public class Test
  {
  
          public static final List&lt;String&gt; highPrio = Arrays.asList("*","/");
          public static List&lt;String&gt; ops;
  
          public static void main(String[] args)
          {
                  //ERROR HERE, why do it throw nullPointer?
                  ops.addAll(highPrio);
  
                  for(String s : ops)
                  {
                          System.out.println(s);
                  }
          }
  }
  </code></pre>
  
  <p><strong>Why not new List() in the initialization?</strong></p>
  
  <p>The reason for not initialization was the inability to use <code>= new List&lt;String&gt;()</code>. I cannot see a logic not allowing it. It must have something to do with intrinsic factors such as data strucs or something else.</p>
  
  <p><code>Test.java:7: java.util.List is abstract; cannot be instantiated
          public static List&lt;String&gt; ops = new List&lt;String&gt;();</code></p>
  
  <p><strong>Why list is an interface?</strong></p>
  
  <p>I know that many data strucs such as stack implements list. But I cannot understand why List is an interface and why not Table for example. I see list as a primitive structure with which you can implement other structures. Interface is a thing where you can specify requirements for a structure. Is the primitivenness or extensivenss reason for being an interface? </p>