title: How to interpret "public <T> T readObjectData(... Class<T> type)" in Java?
body: <p>I have this Java code.</p>
  
  <pre><code>public &lt;T&gt; T readObjectData(ByteBuffer buffer, Class&lt;T&gt; type) {
  ...
  T retVal = (T) summaries;
  return retVal;
  </code></pre>
  
  <p>How to interpret this code? Why do we need <code>public &lt;T&gt; T</code> instead of <code>public T</code>?</p>
  
  <p>How to give the parameter to the 2nd argument (<code>Class&lt;T&gt; type</code>)?</p>