JavaScript required
We’re sorry, but Coda doesn’t work properly without JavaScript enabled.
Skip to content
Gallery
csHjavaA-2019
about this document
revision
traverse and process
standard algorithms
Parallel Arrays
read text files
write text files
CSV files
Letter frequency
development workflow
indices
More
Share
Explore
Parallel Arrays
parallel arrays
Parallel arrays are used to store a table of values with two more more headings.
One array is used for each column, the data type of each array must match the type of the values in the column.
Every array will have the same number of elements (rows).
Each array will have its own name which usually describes the values.
For example two parallel arrays could be used to store the names of the 4 seasons and the number of days in each season.
The season name array will be a String array for storing text.
The days array will be an integer array.
A row from the table uses values from different arrays but the same position in each array (parallel arrays).
To display the information for the first season:
display season[0] + days[0]
Visualising parallel arrays in BlueJ java
Loading…
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
Ctrl
P
) instead.