Mr. Brewer's Java: Ch. 8 Review Questions

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

holds values that correspond to those in another array

A parallel array is one that _____.

value

A single array element of a primitive type is passed to a method by _____.

all have the same type

An array is a list of data items that _____________.

references

Array names represent _____________.

Yes

Assume an array is declared as follows. Would the statement: for(x = 0; x < 4; ++x) num[x] = 100; correctly assigns the value 100 to each of the array elements? int[] num = new int[4];

34

For how many integers does the following statement reserve room? int[] value = new int[34];

scholar[0].setID(1234);

If a class named Student contains a method setID() that takes an int argument and you write an application in which you create an array of 20 Student objects named scholar, which of the following statements correctly assigns an ID number of 1234 to the first Student scholar?

the return type in the method header is followed by square brackets

If a method should return an array to its calling method _____.

num[5]

If you declare an array as follows, how do you indicate the final element of the array? int[] num = new int[6];

303

If you declare an integer array as follows, what is the value of num[2]? int[] num = {101, 202, 303, 404, 505, 606};

all of them

In Java, you can declare an array of 12 elements and initialize _____.

3

Suppose you have declared an array as follows: int[] creditScores = {670, 720, 815}; What is the value of creditScores.length?

null

Unicode value '\u0000' is also known as _____________.

you might reserve memory for it in the same statement

When you declare an array, _____________.

do not explicitly give the array a size

When you initialize an array by giving it values upon creation, you _____________.

a copy of the value in the element

When you pass an array element to a method, the method receives _____________.

the address of the array

When you pass an array to a method, the method receives _____________.

int

Which of the following can be used as an array subscript?

use the keyword new

You reserve memory locations for an array when you _____________.

Yes

would setting up parallel arrays be useful in the following situation? You need to look up an employee's ID number to find the employee's last name.


संबंधित स्टडी सेट्स

Quiz 3: Assyrian and Babylonian Civilizations

View Set

DNA STRUCTURE AND REPLICATION: (chapter 9)

View Set

NUR 310 Exam 2 Ch. 28, 45, and 25

View Set

Development, sensation and perception Test Final Questions

View Set