Advertisement
cd62131

Dimension2

Mar 3rd, 2014
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.51 KB | None | 0 0
  1. import java.util.AbstractMap.SimpleEntry;
  2. import java.util.ArrayDeque;
  3. import java.util.Deque;
  4.  
  5. public class Dimension2 {
  6.   public static void main(String[] args) {
  7.     int[][] a = {{1, 2}, {3, 4}, {5, 6}};
  8.     Deque<SimpleEntry<Integer, Integer>> as =
  9.       new ArrayDeque<SimpleEntry<Integer, Integer>>();
  10.     for (int i = 0; i < a.length; i++) {
  11.       as.offer(new SimpleEntry<Integer, Integer>(a[i][0], a[i][1]));
  12.     }
  13.     System.out.println(as);
  14.     as.pollLast();
  15.     System.out.println(as);
  16.   }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement