Filters
Question type

Study Flashcards

The ____________ loop structure can be used to iterate through an array. However, it can be used for read-only access to the elements.

Correct Answer

verifed

verified

If you try to access the array using a negative index value, ____.


A) a compilation error will be generate
B) a runtime error will be generated
C) the indexed location will be used.Β Β The computer will access memory to the left of the array
D) the smallest indexed location will be accessed

Correct Answer

verifed

verified

One of the special properties in the Array class is ____________. It returns an int representing the total number of elements in an array.

Correct Answer

verifed

verified

When an array is sent to a method as an argument, if the method changes one or more of the elements, the changes are made to the actual data.

Correct Answer

verifed

verified

____ creates a copy of the array and returns it as an object?


A) CopyObject( )
B) Clone( )
C) Copy( )
D) CreateArray( )

Correct Answer

verifed

verified

If an array named num is dimensioned to hold 10 values, what happens if you write num[100] = 50;?


A) A compilation error will be generated
B) A runtime error will be generated
C) 50 will be stored at the 100th indexed location
D) 50 will be stored at the last legal location

Correct Answer

verifed

verified

When two or more arrays have a relationship such that you are able to use the same subscript or index to refer to related elements in the arrays, you have ____ arrays.


A) parallel
B) two dimensional
C) dynamic
D) related

Correct Answer

verifed

verified

You can instantiate arrays of user-defined array objects and send in arrays as arguments to methods, but you cannot return arrays from methods.

Correct Answer

verifed

verified

If an array named num is dimensioned to hold 10 values, how would you store 50 in the 5th physical location?


A) num[5] = 50;
B) num[4] = 50;
C) num = 50 [5] ;
D) num5 = 50;

Correct Answer

verifed

verified

What happens when you assign one array to another using the assignment operator?


A) An error message is generated.
B) Elements are copied to new memory locations.
C) Both arrays become value type data elements.
D) Both arrays reference the same memory locations.

Correct Answer

verifed

verified

The length or size of the array is specified using a(n) ____________ value in the form of a constant literal, a variable, or an expression that produces an integer value.

Correct Answer

verifed

verified

Arrays can be used as fields or instance variables in classes; and, arrays of objects can be declared.

Correct Answer

verifed

verified

To declare and instantiate memory for 4 exam scores that range in value from 0 to 100, the following declaration could be made ____.


A) int examScore = new examScore[3];
B) int [ ] examScore = new examScore[4];
C) int [ ] examScore = new examScore[3];
D) int examScore[4] = new examScore[ ];

Correct Answer

verifed

verified

Properties are added to a class to enable client applications to access public members.

Correct Answer

verifed

verified

Array identifiers are normally defined using a plural noun.

Correct Answer

verifed

verified

Showing 61 - 75 of 75

Related Exams

Show Answer