lecture6 - CS116 OBJECTORIENTED PROGRAMMINGII LECTURE6...

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

View Full Document Right Arrow Icon
CS 116 OBJECT ORIENTED  PROGRAMMING II LECTURE 6 GEORGE KOUTSOGIANNAKIS Copyright:  20010 Illinois Institute of Technology/George Koutsogiannakis 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
Last lecture’s topics Binary Search of an array. Using Arrays as counters. Vectors. Multi-dimentional Arrays 2
Background image of page 2
This lecture’ s topics Continue with multi dimensional arrays ArrayList 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
The  ArrayList  Class Arrays have a fixed size once they have been  instantiated.  What if we don't know how many elements we  will need? For example, if we are reading values from a file returning search results We could create a very large array, but then we  waste space for all unused elements. A better idea is to use an  ArrayList , which  stores elements of object references and  automatically expands its size, as needed. 4
Background image of page 4
The  ArrayList  Class The  ArrayList  class is in the package:  java.util All  ArrayList  elements are object references,  so  
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 06/27/2010 for the course CS 116 taught by Professor Koutsogiannakis during the Summer '08 term at Illinois Tech.

Page1 / 14

lecture6 - CS116 OBJECTORIENTED PROGRAMMINGII LECTURE6...

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