CS Awesome - Unit 6 Vocabulary

0.0(0)
Studied by 2 people
0%Unit 6 Mastery
0%Exam Mastery
Build your Mastery score
multiple choiceMultiple Choice
call kaiCall Kai
Supplemental Materials
Card Sorting

1/11

Last updated 8:23 PM on 3/31/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

12 Terms

1
New cards

Array

An array can hold many items (elements) of the same type. You can access an item (element) at an index and set an item (element) at an index.

2
New cards

Array Declaration

To declare an array specify the type of elements that will be stored in the array, then ([]) to show that it is an array of that type, then at least one space, and then a name for the array. Examples: int[] highScores; String[] names;

3
New cards

Array Creation

To create an array type the name and an equals sign then use the new keyword, followed by a space, then the type, and then in square brackets the size of the array (the number of elements it can hold). Example: names = new String[5];

4
New cards

Array Index

You can access and set values in an array using an index. The first element in an array called arr is at index 0 arr[0]. The last element in an array is at the length minus one - arr[arr.length - 1].

5
New cards

Array Initialization

You can also initialize (set) the values in the array when you create it. In this case you don't need to specify the size of the array, it will be determined from the number of values that you specify. Example: int[] highScores = {99,98,98,88,68};

6
New cards

Array Length

The length of an array is the number of elements it can hold. Use the public length field to get the length of the array. Example: given int[] scores = {1,2,2,1,3,1};, scores.length equals 6.

7
New cards

Class Method

A method that can be called on the class. It is declared using the static keyword. An example is Math.abs(-3).

8
New cards

Element Reference

A specific element can be referenced by using the name of the array and the element's index in square brackets. Example: scores[3] will return the 4th element (since index starts at 0, not 1). To reference the last element in an array, use array[array.length - 1]

9
New cards

For

each Loop - Used to loop through all elements of an array. Each time through the loop the loop variable will be the next element in the array starting with the element at index 0, then index 1, then index 2, etc.

10
New cards

Out of Bounds Exception

An error that means that you tried to access an element of the array that doesn't exist maybe by doing arr[arr.length]. The first valid indices is 0 and the last is the length minus one.

11
New cards

for

starts both a general for loop and a for-each loop. The syntax for a for each loop is for (type variable : array). Each time through the loop the variable will take on the next value in the array. The first time through the loop it will hold the value at index 0, then the value at index 1, then the value at index 2, etc.

12
New cards

static

used to create a class method, which is a method that can be called using the class name like Math.abs(-3).

Explore top notes

note
Chapter 2 - The Role of Prices
Updated 1134d ago
0.0(0)
note
7.2 Transcription
Updated 1153d ago
0.0(0)
note
Unit 2
Updated 692d ago
0.0(0)
note
Untitled
Updated 1069d ago
0.0(0)
note
Unit One Booklet 4
Updated 513d ago
0.0(0)
note
UO6 and UO7
Updated 1028d ago
0.0(0)
note
Chapter 2 - The Role of Prices
Updated 1134d ago
0.0(0)
note
7.2 Transcription
Updated 1153d ago
0.0(0)
note
Unit 2
Updated 692d ago
0.0(0)
note
Untitled
Updated 1069d ago
0.0(0)
note
Unit One Booklet 4
Updated 513d ago
0.0(0)
note
UO6 and UO7
Updated 1028d ago
0.0(0)

Explore top flashcards

flashcards
periodic table 52 elements
52
Updated 919d ago
0.0(0)
flashcards
War horse ch.1-8
24
Updated 443d ago
0.0(0)
flashcards
Edexcel IGCSE History, USA
124
Updated 802d ago
0.0(0)
flashcards
theology final
100
Updated 299d ago
0.0(0)
flashcards
La Comida vocab, parte 2
33
Updated 213d ago
0.0(0)
flashcards
climate change
55
Updated 1211d ago
0.0(0)
flashcards
periodic table 52 elements
52
Updated 919d ago
0.0(0)
flashcards
War horse ch.1-8
24
Updated 443d ago
0.0(0)
flashcards
Edexcel IGCSE History, USA
124
Updated 802d ago
0.0(0)
flashcards
theology final
100
Updated 299d ago
0.0(0)
flashcards
La Comida vocab, parte 2
33
Updated 213d ago
0.0(0)
flashcards
climate change
55
Updated 1211d ago
0.0(0)