Assessment 6: Generics, Collections, and Exceptions
This assessment will measure your ability to:
- Understand generics in Java
- Understand some of the
Collections interfaces in Java
- Understand common causes of exceptions and how to handle them
- Understand Junit test cases (and running them on Eclipse)
- Write Java code with good style, elegance, and readability
This assessment is designed to be completed in fifty minutes or less.
You'll be modifying your classes from Project 3.
In particular, you'll be replacing all arrays in your code with
various classes that implement some of the interfaces in the Java Collections Framework, as well as extending some of your
You'll need to do the following for this assessment:
- Change the types of all arrays in your
Profile class to be from one of Java's Collections Framework.
- Use generics correctly in every instance where you make the change above.
- Write a more complex and robust
equals method, that can handle any possible argument to the method (even
- Update your
Analyzer class so it compiles against these other changes.
- Replace a for loop with an iterator.
- Implement the
Comparable interface for a class.
We will not have a sample assessment in the same way as we did for previous assessments; please refer to the bullets above and
make sure you study those topics for the assessment itself.
As practice, download the
classes and practice rewriting the for loop with an iterator instead.
Upload all of your project files to Marmoset using the link to assessment6_sample. Make sure you click the correct link,
as there are ten versions of this assessment, and your answers will only work for one of them.
See the instructions below to walk you through how to upload a file to Marmoset.
[Marmoset upload help] (opens in new window)