Académique Documents
Professionnel Documents
Culture Documents
Programming Applications
Lab Solutions
Exercise 2 Collections
The
solution
to
this
is
available
as
a
separate
zip
file
called
uk.ac.kcl.inf.4ccs1pra.lab1.basic.zip. It should be noted that this is one possible solution, but by no means the only one possible. So, as long as your solution does what is required, it is
valid! Notice that the zip file already contains the solution to Exercise 4 as well, so ignore class Main
for the moment.
A note on the ZIP files: These have been created by exporting the corresponding Eclipse projects.
From Eclipse, you should be able to view and test the sources by right-clicking in the package explorer and selecting 'Import'. In the dialogue window that opens, choose "General/Existing Project"
and click "Next". Select the "Archive File" radio button and use the browse button to find the ZIP file.
You should then be able to click on "Finish", which will create a new Java Project with the sources
from the ZIP file.
For other IDEs or for testing the code from the command line, please first unzip the ZIP file. You are
only interested in the contents of the src/ folder. If you use NetBeans or another IDE, copy the entire
contents of the src/ folder into the source folder of a new project. When running from the command
line, make sure to run your java compiler and virtual machine from the src/ folder (or, alternatively, to
include the src/ folder into your classpathfor example, by using the cp option).
Exercise 3 Debugging
There is no sample solution to this task.