// Textbook fragment 02.A.03 public static void main(String[] args) { Pair[] a = new Pair[10]; // right, but gives a warning Pair[] b = new Pair[10]; // wrong!! a[0] = new Pair(); // this is completely right a[0].set("Dog",10); // this and the next statement are right too System.out.println("First pair is "+a[0].getKey()+", "+a[0].getValue()); }