<p>So, let's say I want to write a class that operates on different kinds of numbers, but I don't a priori know what kind of numbers (i.e. ints, doubles, etc.) I will be operating on.</p>

<p>I would like to use generics to create a general class for this scenario.  Something like:</p>

<pre><code> Adder&lt;Double&gt; adder = new Adder&lt;Double&gt;();
 adder.add(10.0d, 10.0d);   // = 20.0d
</code></pre>

<p>But, I cannot instantiate the generic type I pass in to my Adder class!  So -- what to do?</p>

Uh oh---generics are not C++ templates. Because of type erasure, the
```
Double
```
in your example won't even show through to the runtime system.
In your particular case, if you just want to be able to add various types together, may I suggest method overloading? e.g.,
```
double add(double, double)
```
,
```
float add(float, fload)
```
,
```
BigDecimal add(BigDecimal, BigDecimal)
```
, etc.