title: Generic method java 6 <T> before return type
body: <p>What is the difference between:</p>
  
  <pre><code>public &lt;T&gt; void createArray(T sample){
      ArrayList&lt;T&gt; list = new ArrayList&lt;T&gt;();
      list.add(sample);
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public void createArray(T sample){
      ArrayList&lt;T&gt; list = new ArrayList&lt;T&gt;();
      list.add(sample);
  }
  </code></pre>
  
  <p>I read that the method signature for using types should have <code>&lt;T&gt;</code> before the return type but how come I am still able to create the method without the <code>&lt;T&gt;</code>? What is the implication if I do or do not put it?</p>