|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--NameList
This class is a simple example of creating, initializing, and using an ArrayList. It is based on the same class that was implemented with regular arrays in the ex15 examples.
| Constructor Summary | |
NameList(int count)
The NameList class manages an ArrayList of names. |
|
| Method Summary | |
void |
addName()
Add another name to the list at random |
java.lang.String |
getName(int idx)
retrieve the name at a particular index |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public NameList(int count)
count - initial number of strings in the ArrayList| Method Detail |
public java.lang.String getName(int idx)
idx - the index of the desired name
public void addName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||