- Right-click on the Projects window.
Select
New Project
Java
Java Application, then
Next.
Give it the name AListDemo. Keep all the default settings.
Click Finish.
- Copy/Paste the code from alistdemo.Main in the
ArrayList First Example section
into the Main class you just created (overwriting what was there).
- Run the project. The green triangle icon will achieve this. Compare the output to the code which generated it to
try and fully understand the operations.
When you're done, kill the Output window (it will be recreated as needed).
- Go to the Strings from a website section. Right-click on the Source Packages line and
select New
Java Class. Enter the information in
the appropriate fields:
Class Name: DocCatcher
package: util
Then Cut/Paste from util.DocCatcher code into the class you just created.
- Repeat the previous step for:
Class Name: WordProcess
package: util
- Scroll down to find the Revised main function subsection and follow the
instructions to run the main2 function.
- Continue into the
AListAdapter and
ArrayList Implementation
sections. As above, do
the create/copy/paste operation in order to create these two implementation
classes:
Class Name: AListAdapter
package: alist
and
Class Name: AList
package: alist
Then follow the instructions in the Test Drive subsection to make sure
that these classes work.
The next steps try to help you understand how the © Robert M. Kline