Yurttas/PL/OOL/CS/F/06/01/02/TT.java

 1/**
 2 *  Copyright(C) 2004
 3 *  All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc..
 4 *
 5 *  Permission to use, copy, modify, and distribute this
 6 *  software and its documentation for EDUCATIONAL purposes
 7 *  and without fee is hereby granted provided that this
 8 *  copyright notice appears in all copies.
 9 *
10 *  date   : September 1, 2004.
11 *  authorĀ : Salih Yurttas.
12 */
13
14
15public class TT<T0,
16                T1> {
17
18  public void tA(final TA<T0,
19                          T1> o,
20                 final T0 t0,
21                 final T1 t1) {
22    o.output();
23
24    int n = o.getSize0();
25
26    T0[] ta0 = new T0[n];   // this won't compile!
27
28    ta0 = o.getA0();
29
30    for(int i=0; i<n; i++)
31      System.out.println(ta0[i]);
32
33    System.out.println();
34
35    n = o.getSize1();
36
37    T1[] ta1 = new T1[n];   // this won't compile!
38
39    ta1 = o.getA1();
40
41    for(int i=0; i<n; i++)
42      System.out.println(ta1[i]);
43
44    System.out.println();
45
46    o.setA0(t0);
47    o.setA1(t1);
48
49    o.output();
50  }
51
52}