Specifications
Sun Services
Java™ Programming Language
Module 6, slide 18 of 43
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Heterogeneous Collections
• Collections of objects with the same class type are
called homogeneous collections. For example:
MyDate[] dates = new MyDate[2];
dates[0] = new MyDate(22, 12, 1964);
dates[1] = new MyDate(22, 7, 1964);
• Collections of objects with different class types are
called heterogeneous collections. For example:
Employee [] staff = new Employee[1024];
staff[0] = new Manager();
staff[1] = new Employee();
staff[2] = new Engineer();










