Single Dimensional Arrays Flashcards

1
Q

Is a data structure that represents a collection of same types data elements

A

Array

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

How much can a single dimensional array store data elements?

A

One row

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

Strings are Arrays

A

String Name = “John Smith”;
String courseNumber;

courseNumber = new String (“CS 1301’’);

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

How do you allocate memory space for the array? arrayRefVar= new datatype [arraySize];

A

Example:
myList = new double [10];
yourList = new int [100];
herList

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

How do you declare a single-dimensional array in Java?

A

Us the syntax: datatype[] array RefVar;
Example: int[] myList;

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

How do you create an array in Java?

A

Use the syntax: arrayRefVar= new datatype[arraySize];
Example: myList = new int[10];

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

How do you access elements in an array?

A

Access elements using the array’s index, starting at 0.
Example: mylist [0] = new int[10]

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

How do you create an array in Java?

A

Use the syntax: arrayRefVar = new datatype [arraySize];
Example: myList = new int(10);

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

How do you access elements in an array?

A

Access elements using the array’s index, starting at 0.
Example: myList[0] = 25.7;

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

What are the default values for an array in Java?

A

Numeric types: 0, Boolean: False, Object references: null

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

Indexed variables in an array?

A

An indexed variable references to array elements using their using their index, like arrayRefVar[index];

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