The Department of Computer Science & Engineering
cse@buffalo
STUART C. SHAPIRO: CSE 115 C

CSE 115
Introduction To Computer Science for Majors I
Lecture C
Lecture Notes #14
Stuart C. Shapiro
Spring, 2007


java.util.HashSet<E>s

A collection class that can hold a set of objects.
To create a new HashSet whose members will be of the type memberType:
new java.util.HashSet<memberType>()
For example:
pack = new java.util.HashSet<animals.Dog>()

Iteration with for each

for (variable : collection) block

Interfaces

First Previous Next

Copyright © 2007 by Stuart C. Shapiro. All rights reserved.

Last modified: Fri Oct 12 10:51:09 EDT 2007
Stuart C. Shapiro <shapiro@cse.buffalo.edu>