Yurttas/PL/OOL/Java/F/02/04/02/01/IDA00.java
Jump to navigation
Jump to search
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 IDA00 {
16
17 public static void main(String[] args) {
18 IA o1 = new IA(2,
19 2);
20
21 o1.output();
22
23 int n = o1.getSize0();
24
25 int[] ia = new int[n];
26
27 ia = o1.getA0();
28
29 for(int i=0; i<n; i++)
30 System.out.println(ia[i]);
31
32 System.out.println();
33
34 n = o1.getSize1();
35
36 ia = new int[n];
37
38 ia = o1.getA1();
39
40 for(int i=0; i<n; i++)
41 System.out.println(ia[i]);
42
43 System.out.println();
44
45 o1.setA0(5);
46 o1.setA1(8);
47
48 o1.output();
49
50 System.out.println();
51
52 DA o2 = new DA(2.0,
53 2.0);
54
55 o2.output();
56
57 n = o2.getSize0();
58
59 double[] da = new double[n];
60
61 da = o2.getA0();
62
63 for(int i=0; i<n; i++)
64 System.out.println(da[i]);
65
66 System.out.println();
67
68 n = o2.getSize1();
69
70 da = new double[n];
71
72 da = o2.getA1();
73
74 for(int i=0; i<n; i++)
75 System.out.println(da[i]);
76
77 System.out.println();
78
79 o2.setA0(5.0);
80 o2.setA1(8.0);
81
82 o2.output();
83 }
84
85}