I have several types "Point". there is general class Point and several inheritants of it: NEPoint extends Point
I have a generic Reader that reads points from some kind of Reader.
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
...
}
}
How should I do it?