New to Java Generics - why is there a Type for a return type of void in Generics?
<p>I am new to JAVA generics below the return type is void but why are they giving the type . </p>

<pre><code>public static &lt;U&gt; void addBox(U u,List&lt;Box&lt;U&gt;&gt; boxes){
    Box&lt;U&gt; box = new Box&lt;U&gt;();
    box.setT(u);
    boxes.add(box);
}
</code></pre>
