comp 2 Flashcards
Aside from the ______ programmers can also declare arrays that holds elements of OBJECTS.
primitive data types,
true or false
Programmers can’t create separate Student objects with unique names.
false
can
To use a method that belongs to an object that is part of an array,
you insert the appropriate subscript notation after the array name and before the dot that precedes the method name.
stud is a _____ that represents each element of emps in turn.
local variable
Using the enhanced for loop :
eliminates the need to use a limiting value for the loop and eliminates the need for a subscript following each element.
In Java, programmers can also
create an array of String objects.
Notice that subject.length; refers to the ______ and NOT TO THE LENGTH OF ANY STRING OBJECTS stored in the subject array.
length of the array subject (three elements)
two things to remember in manipulating arrays of strings
Remember:
Arrays use a length field (no parentheses follow).
String objects use a length() method.
is one with the same number of elements as another, and for which the values in corresponding elements are related.
Parallel Array
Application of Parallel Arrays:
SEARCHING & SORTING.
a variable that holds a value as an indicator of whether some condition has been met. Example: isValid.
Flag
FILL N THE BLANKS!
Searching an array for an exact match is ___ _____ practical.
NOT ALWAYS
comparing a value to the endpoints of numerical ranges to find the category in which a value belongs.
Range Match
The individual array elements are ______
passed by value;
passed by value; that is, a copy of the value is _____
made and used within the receiving method