0

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?

Vadim
  • 105
  • 1
  • 9
  • I found that one way to instantiate is using default constructor. Is there a way to instantiate with constructor that have parameters? – Vadim Oct 01 '14 at 06:05
  • http://stackoverflow.com/questions/6241513/how-to-create-instance-of-a-class-with-the-parameters-in-the-constructor-using-r – Jens Schauder Oct 01 '14 at 06:46

0 Answers0