0

Possible Duplicate:
Initialization of an ArrayList in one line

I am new to java and have a few question about lists.

I got defined variables x and y.

I want to create a list with lists of containing {x+1,y+1}, {x-1,y-1} etc
I tried something like this:

List<List<T>> currentList;

and then try to add items to it, but then it does not work

Is there an easy way to define such list in one line? Is it possible then iterate through the pairs of values to manipulate them?

Any help is much appreciate!!! :)

Community
  • 1
  • 1
noqa
  • 313
  • 2
  • 4
  • 11

0 Answers0