S
scherer_mike
dear all,
i have a little problem of understanding and i am not able to get out
of it:
et voilà the snippets:
with java 1.4 i wrote:
// -------------------------------------------------------
myclass cc = ...;
....
List myList;
myList = new ArrayList();
....
myList.add(cc);
same with 1.5 to make it typesafe:
// -------------------------------------------------------
myclass cc = ...;
....
List < myclass > myList;
myList = new < myclass > ArrayList();
....
myList.add(cc);
so far, so good ... but now the snippet with 2 dimensional array of
ArrayList with 1.4
// -------------------------------------------------------
myclass cc = ...;
....
List myTable[][] ;
mytable = new ArrayList[n][n];
....
myTable[a].add(cc);
this works well with 1.4. but this last snippet typesafe with 1.5 ... i
cannot solve! Whereever i place the < type > thingy in the source, i
get an error message.
could you advise me, please?
thank you very much,
Michael
i have a little problem of understanding and i am not able to get out
of it:
et voilà the snippets:
with java 1.4 i wrote:
// -------------------------------------------------------
myclass cc = ...;
....
List myList;
myList = new ArrayList();
....
myList.add(cc);
same with 1.5 to make it typesafe:
// -------------------------------------------------------
myclass cc = ...;
....
List < myclass > myList;
myList = new < myclass > ArrayList();
....
myList.add(cc);
so far, so good ... but now the snippet with 2 dimensional array of
ArrayList with 1.4
// -------------------------------------------------------
myclass cc = ...;
....
List myTable[][] ;
mytable = new ArrayList[n][n];
....
myTable[a].add(cc);
this works well with 1.4. but this last snippet typesafe with 1.5 ... i
cannot solve! Whereever i place the < type > thingy in the source, i
get an error message.
could you advise me, please?
thank you very much,
Michael