Java Generics , . Sun , , . :
List<Number> list = new ArrayList<Number>();
list.add(2.0);
list.add(-2);
list.add(new BigDecimal("1.23456789");
List list = new ArrayList();
Double temp = new Double(2.0);
if (!temp instanceof Number) throw new ClassCastException();
list.add(temp);
, instanceof .
, list.getClass() == ArrayList.class , ++. List<Boolean> . , ++, :
template<int length, int time, int mass>
class measurement {...}
, .