Generics: how to read actual type parameters



For example:

public class Pair<S> {

public Pair(S first, S second) {

this.first = first;
this.second = second;
}

public String toString() {
Class clas = ??? ;
return "Pair of " + clas.toString();
}

public S first;
public S second;
}

so that after instantiating

Pair<Double> p = new Pair<Double>( 0.0, 0.0 );

p.toString() gives "Pair of Double"

TIA

.