Advertisement
Guest User

Untitled

a guest
Jan 24th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1.         Point [][] p = new Point[10][2];
  2.        
  3.         for (int i = 0; i < p.length;i++){
  4.             Point c = new Point((int)(Math.random() * ((10 - 0) + 1)) + 0,  //Random points
  5.                             (int)(Math.random() * ((10 - 0) + 1)) + 0);
  6.             p[i][1] = c;
  7.         }
  8.        
  9.         System.out.println(p[2][1]);
  10.        
  11.      for(int row=0; row < p.length;row++){
  12.          for (int column = 0; column < p[row].length;column++) {
  13.             System.out.print(p[row][column] + " ");
  14.     }
  15.     System.out.println();
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement