Program Output

The abbreviated output is as follows:

Script started on Wed Apr 26 14:41:38 2006
prompt >>
prompt >> java ArrayListExample
----------------------------------------------
Create/Store objects in an ArrayList container
----------------------------------------------

  - Storing Integer(0)
  - Storing Integer(1)
  - Storing Integer(2)
  - Storing Integer(3)
  - Storing Integer(4)
  - Storing Integer(5)
  - Storing Integer(6)
  - Storing Integer(7)
  - Storing Integer(8)
  - Storing Integer(9)
  - Storing String(Alex)
  - Storing String(Melody)
  - Storing String(Jeff)
  - Storing String(Alex)
---------------- 
Retrieve Objects
----------------

0
1
2
3
4
5
6
7
8
9
Alex
Melody
Jeff
Alex
-------------------------------------
Retrieve objects using a ListIterator
-------------------------------------

Element [0] = 0
  - hasPrevious    = true
  - hasNext        = true
  - previousIndex  = 0
  - nextIndex      = 1

Element [1] = 1
  - hasPrevious    = true
  - hasNext        = true
  - previousIndex  = 1
  - nextIndex      = 2

... lines of output removed ....

Element [9] = 9
  - hasPrevious    = true
  - hasNext        = true
  - previousIndex  = 9
  - nextIndex      = 10

Element [10] = Alex
  - hasPrevious    = true
  - hasNext        = true
  - previousIndex  = 10
  - nextIndex      = 11

Element [11] = Melody
  - hasPrevious    = true
  - hasNext        = true
  - previousIndex  = 11
  - nextIndex      = 12

Element [12] = Jeff
  - hasPrevious    = true
  - hasNext        = true
  - previousIndex  = 12
  - nextIndex      = 13

Element [13] = Alex
  - hasPrevious    = true
  - hasNext        = false
  - previousIndex  = 13
  - nextIndex      = 14

-----------------------------
Retrieve objects via an index
-----------------------------

[0] - 0
[1] - 1
[2] - 2
[3] - 3
[4] - 4
[5] - 5
[6] - 6
[7] - 7
[8] - 8
[9] - 9
[10] - Alex
[11] - Melody
[12] - Jeff
[13] - Alex

------------------------------------------
Search for an object and retrieve an index
------------------------------------------

Index location of the String "Jeff" is: 12
prompt >>
prompt >> exit
Script done on Wed Apr 26 14:41:49 2006