1

I need some help on this code. I am not sure how I write this particular line. I have this class:

public class MyController<T extends MyModel> extends AnotherController {

    // Taking xModel and copies properties to YModel

    private T myModel(T xModel) {
        T yModel = new T();
        copyMyProperties(yModel, xModel);
        return yModel;
    }

}

at T(), I am getting "cannot instantiate type T". Any suggestions what I am doing wrong here? Thank you in advance.

aboger
  • 2,214
  • 6
  • 33
  • 47
pj_max
  • 127
  • 8

0 Answers0