Java interview
From Hawk Wiki
Revision as of 03:16, 4 April 2012 by Hall (Talk | contribs) (Created page with "==Basic== ===Generic === Similar with c++ template. <pre class="java"> →* * Generic version of the Box class. * @param <T> the type of value being boxed: public class Box<...")
Basic
Generic
Similar with c++ template.
/** * Generic version of the Box class. * @param <T> the type of value being boxed */ public class Box<T> { // T stands for "Type" private T t; public void add(T t) { this.t = t; } public T get() { return t; } }