Download presentation
Presentation is loading. Please wait.
1
Chapter 8 Collection Types
2
Collection A collection is an object that holds other objects. It is a storage mechanism with operations for adding and removing elements and for accessing and perhaps updating their values.
3
Student Question Can a collection contain other collections?
4
Collection Interface The generic Collection interface defines a set of operations that characterize the behavior of most collection classes.
5
Collection Interface (cont’d)
6
Collection Interface (cont’d)
7
Student Question Why did the methods contains and remove have a parameter of type Object instead of a parameter of the generic type T? Why does the toArray method return an array of Objects rather than an array of generic type T?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.