Chapter 8 Flashcards

1
Q

What is an Array?

A
  • Named list of data items with the same data type
  • Each data item is an element of the array
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you name an array?

A
  • Provide any legal identifier
  • Same naming conventions as variables
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does int[] someNums; or int[] someNums = null;

A
  • No computer memory adress is assigned
  • The array has the special value null
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What do array names represent?

A
  • Computer memory adress
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is a instance variable for arrays?

A
  • A fielt automatically assigned a value for every array you create
  • Length field
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is a flag?

A
  • A variable that holds a value as an indicator of whether or not a condition has been met
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What happens if you pass a whole array into a method?

A

The array can change

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does the length field return in a two-dimensional array?

A

How many rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are jagged arrays?

A
  • Rows of different lengths
  • Also called ragged array or non-rectangular array
  • Define number of rows, but not columns
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you use the arrays class?

A

Import java.util.Arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the Array class methods?

A

BinarySearch()
equals()
fill()
sort() * Ascending
ParrelelSort *Ascending

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are Enumerations?

A
  • Finite set of legal values
  • Constants are all uppercase
  • no equals
  • no Quotes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the enum methods?

A

toString()
Ordinal() * position
equals() * tests if two enums are equal

compare() * returns a value based on ordinal value

valueOf() accepts a string aprameter and returns an enum

value() returns an array of the enums

How well did you know this?
1
Not at all
2
3
4
5
Perfectly