Data Structures and Collections in Java
Code examples
- Use cases for
ArrayList, HashMap, Iterator, Random, Comparable (in Java 5)
- HashMap example - frequencies
(in Java 5)
Home reading
- The
collections framework in Java documentation
- Object
basics and simple data objects, in Java Tutorial (General OOP,
preliminary reading)
- Collections,
in Java Tutorial
- Arrays,
vectors, etc., by David Eck
- Generic
programming, by David Eck (Suggested reading and exercises)
- Vectors,
hashtables, and enumerations, by Dick Baldwin (Legacy API)
- Generics
tutorial, by Gilad Bracha (Java 5 specific, advanced)
Practice
Write static methods to calculate union
and intersection of two sets (of type HashSet).
Jaanus Pöial, 2006