1 chapter 9 arrays java programming from thomson course tech, adopted by kcluk

Download 1 Chapter 9 Arrays Java Programming from Thomson Course Tech, adopted by kcluk

If you can't read please download the document

Upload: oliver-cook

Post on 18-Jan-2018

217 views

Category:

Documents


0 download

DESCRIPTION

3 One-Dimensional Arrays Syntax to instantiate an array: –dataType[ ] arrayName; arrayName = new dataType[intExp] –dataType[ ] arrayName = new dataType[intExp] –dataType[ ] arrayName1, arrayName2; Syntax to access an array component: –arrayName[indexExp] intExp = number of components in array >= 0 0

TRANSCRIPT

1 Chapter 9 Arrays Java Programming from Thomson Course Tech, adopted by kcluk 2 Array Definition: structured data type with a fixed number of components Every component is of the same type Components are accessed using their relative positions in the array 3 One-Dimensional Arrays Syntax to instantiate an array: dataType[ ] arrayName; arrayName = new dataType[intExp] dataType[ ] arrayName = new dataType[intExp] dataType[ ] arrayName1, arrayName2; Syntax to access an array component: arrayName[indexExp] intExp = number of components in array >= 0 0