Arrays
Help!
|
|
||||
|---|---|---|---|---|---|
| Array | A named list of data items that all have the same type
🗑
|
||||
| Element | Each data item in an array
🗑
|
||||
| Declaring Arrays | Ex1: double[] salesFigrues = new double[20];...
Ex2: int[] idNums = new int[100];
🗑
|
||||
| Naming Arrays | Names start with lowercase letter and user uppercase letters to begin subsequent words. Often named using a plural noun and by adding a final word that implies a group
🗑
|
||||
| Subscript(Index) | An integer contained within square brackets that specifies one of an array's elements. AN array's elements are numbered beginning with 0. Ex: salesFigures[0];
🗑
|
||||
| Out of Bounds | When you use a subscript that is too small(negative) or too large for an array. An error message is generated
🗑
|
||||
| Initialization List | A list of values separated by commas and enclosed within curly braces which initialize and array. The size of array is assigned based on the number of values. No keyword new needed. Ex: int[] tenMults = {10, 20, 30, 40, 50, 60};
🗑
|
||||
| Populating an Array | Providing values for all the elements in an array
🗑
|
||||
| Initializing an Array | You cannot directly initialize only part of an array. You either must initialize every element or none of them
🗑
|
||||
| length Field | Contains the number of elements in the array. length is not an array method; it is a field. AN instance variable or object field such as length is also called a property of the object. Ex: scoreArray.length;
🗑
|
||||
| Enhanced for Loop(foreach loop) | Allows you to cycle through an array without specifying the starting and ending points for the loop control variable. Ex: for(int val : scoreArray)...
System.out.println(val);
🗑
|
||||
| Parallel Array | One with the same number of elements as another and for which the values in corresponding elements are related
🗑
|
||||
| Range Match | A process in which you compare a value to the endpoints of numerical ranges to find the category in which a value belongs
🗑
|
||||
| Passed by Value | The individual array elements are passed by value; that is, ca copy of the value is made and used within the receiving method. When any primitive type(boolean, char, byte, short, int, long, float, or double) is passed to a method, the value is passed
🗑
|
||||
| Reference Types | Arrays, like all nonprimitive objects, are reference types; this means that the object actually holds a memory address where the values are stored
🗑
|
Review the information in the table. When you are ready to quiz yourself you can hide individual columns or the entire table. Then you can click on the empty cells to reveal the answer. Try to recall what will be displayed before clicking the empty cell.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
To hide a column, click on the column name.
To hide the entire table, click on the "Hide All" button.
You may also shuffle the rows of the table by clicking on the "Shuffle" button.
Or sort by any of the columns using the down arrow next to any column heading.
If you know all the data on any row, you can temporarily remove it by tapping the trash can to the right of the row.
Embed Code - If you would like this activity on your web page, copy the script below and paste it into your web page.
Normal Size Small Size show me how
Normal Size Small Size show me how
Created by:
TimJavaProgramming
Popular Engineering sets