JavaArraysCollections

JavaArraysCollections - Grouping objects Arrays,...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
Grouping objects Arrays,  Collections and Iterators 1.0
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Main concepts to be covered Arrays  Collections Iterators
Background image of page 2
3 Requirement to group objects Many applications for collections of objects: Personal organizers Library catalogs Student-record system The number of items to be stored varies: Items added Items deleted
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Fixed-size collections Programming languages usually offer a  special fixed-size collection type: an  array Arrays are built-in, use  []  syntax Java arrays can store objects  or primitive-type values Maximum collection size must be  fixed  at Array creation time How is Array creation time more dynamic  than in other programming languages,  such as C++?
Background image of page 4
Creating an array object public class LogAnalyzer { private int[] hourCounts; private LogfileReader reader; public LogAnalyzer() { hourCounts = new int[24] ; reader = new LogfileReader(); } ... } Array object creation
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/06/2008 for the course CSE 432 taught by Professor Blank during the Fall '08 term at Lehigh University .

Page1 / 21

JavaArraysCollections - Grouping objects Arrays,...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online