1 Reply Latest reply: Jan 24, 2012 9:53 AM by jtahlborn RSS

    instantiating anonymous Type as method argument...

    886206
      hi,

      trying to do this, i guess i have stumbled upon a noob's syntax error. any help please?
          private <T extends Dimension> void fillArray(T dim, ArrayList<T> arrayList) {
              for (int i=0; i<dim.getDim();i++) {
                  arrayList.add(new <T>(i+1));
              }
          }
      the error is spotted in the third line and the compiler says: <identifier> expected

      thnx!