Yurttas/PL/OOL/CS/F/02/05/02/04/A04.java

From ZCubes Wiki
Revision as of 08:24, 7 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="java" line start="1" enclose="div">/** * Copyright(C) 1998 * All Rights Reserved. Salih Yurttas, ZCubes, BitsOfCode Software Systems, Inc.. * * P...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
 1/**
 2 *  Copyright(C) 1998
 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   : January 1, 1998.
11 *  @author : Salih Yurttas.
12 */
13
14
15import java.util.Vector;
16
17public class A04 {
18
19  public static void main(String[] args) {
20
21    A a = new A();
22
23    a.printA();
24
25    int i = a.getFirst();
26
27    System.out.println("first = " + i);
28
29    i = a.getLast();
30
31    System.out.println("last  = " + i);
32
33    System.out.println();
34
35    Vector b = new Vector();
36
37    b = a.getA();
38
39    System.out.println("first = " + b.elementAt(0));
40    System.out.println("last  = " + b.elementAt(1));
41
42    System.out.println();
43
44    a.printA();
45
46    a.setFirst(5);
47    a.setLast(9);
48
49    a.printA();
50
51    a.setA(4,3);
52
53    a.printA();
54
55    a.setA(b);
56
57    a.printA();
58
59  }
60
61}