title: Initializing arraylist without object type - JAVA
body: <p>This question is not about why we initialize a list as interface over implementation e.g.</p>
  
  <pre><code>List&lt;myObject&gt; obj = new ArrayList&lt;myObject&gt;();
  </code></pre>
  
  <p>The question is what is the difference between the following two and why do they (apparently) work the same way?</p>
  
  <pre><code>//list and arraylist both have a type
  List&lt;myObject&gt; obj = new ArrayList&lt;myObject&gt;();
  
  //arraylist does not have a type
  List&lt;myObject&gt; obj = new ArrayList&lt;&gt;();
  </code></pre>