Single-Dimensional Arrays and Multidimensional Arrays
Single-Dimensional Arrays and Multidimensional Arrays
Introduction to Programming and Computational Problem Solving - 2
CSE 8B Lecture 5
Announcements
? Assignment 2 is due Oct 21, 11:59 PM ? Quiz 2 is Oct 23 ? Assignment 3 will be released Oct 21
? Due Oct 28, 11:59 PM
? Educational research study
? Oct 23, weekly reflection
? Reading
? Chapters 7 and 8
CSE 8B, Fall 2020
2
Arrays
? Array is a data structure that represents a collection of the same types of data
CSE 8B, Fall 2020
3
Declaring array variables
datatype[] arrayRefVar; ? For example
double[] myList;
If a variable does not contain a reference to an array, the value of the variable is null
datatype arrayRefVar[]; ? For example
double myList[];
This style is allowed, but not preferred
CSE 8B, Fall 2020
4
Creating arrays
arrayRefVar = new datatype[arraySize];
? For example
myList = new double[10];
? myList[0] references the first element in the array ? myList[9] references the last element in the array
CSE 8B, Fall 2020
5
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- single and plural nouns
- single and plural noun worksheets
- difference between single phase and 3 phase
- difference between single and three phase
- 3 phase and single phase
- two dimensional arrays in javascript
- two dimensional arrays in java
- three dimensional arrays java
- 3rd grade arrays and multiplication
- difference between arrays and arraylists
- every single emoji copy and paste
- c arrays and functions