How to create n pairs of coordinates (x, y), how to implement through a cycle or another?

Closed due to the fact that the essence of the question is incomprehensible to the participants by Vlad from Moscow , YurySPb , iluxa1810 , HamSter , cheops 14 Nov '16 at 5:22 .

Try to write more detailed questions. To get an answer, explain what exactly you see the problem, how to reproduce it, what you want to get as a result, etc. Give an example that clearly demonstrates the problem. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • It is not clear, and what problems have a place to be? - Vlad from Moscow
  • I can not make so that variables are created in the amount of n pairs, in which there are 2 coordinates each, I don’t know how to write it down, recently I just started learning the language - Richard

1 answer 1

public class Test { class Pair { int x; int y: public Pair(int x, int y) { this.x = x; this.y = y; } } public static void Main(String[] args) { List<Pair> coords = new ArrayList<>(); for(int i = 0; i < 10; i++) { coords.add(new Pair(i, i)); } } }