我有几种类型" Point"。有一般类Point和它的几个继承: NEPoint扩展了Point
我有一个通用的读取器,可以从某种读取器中读取点数。
public class PointReader<T extends Point> extends BufferedReader {
//there constructor
public T readPoint() {
T result = null;
String str=readLine();
//here I need to instantiate a type T with string parameter str in its constructor
...
}
}
我该怎么做?