+ All Categories
Home > Documents > 1 Chapter 9 Arrays Java Programming from Thomson Course Tech, adopted by kcluk.

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

Date post: 18-Jan-2018
Category:
Upload: oliver-cook
View: 216 times
Download: 0 times
Share this document with a friend
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

If you can't read please download the document

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


Recommended