Ch. 9 Comp Sci

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

A formal array parameter serves as a(n) ____ for the actual array parameter

alias

A _____ statement allows a loop on an array to exit early

break

The variable in an enhanced for loop is bound to each _____ in the array

element

The enhanced for loop moves _____ through an array

forward

Parallele arrays use a common _____ to locate associated elements

index

The position of any individual item within an array is called the items _____, which is also known as its _______.

index, subscript

An array that consists of data in rows and columns is called a(n) _______ array

two-dimensional

The array is a ______ data structure

variable size

The first item in an array is located at index position _____

zero

By default, all array elements in an array of int are initially ___

0

The number of positions for data in an array is called its _____

length

You can determine an array's length by accessing a public instance variable named _____

length

The last position an array is at its _____

length-1

The _____ size of an array is the number of cells that are actually in use by an application, not how many were allocated.

logical

An array's _____ is the number of elements currently in use by the program

logical size

Two-dimensional arrays are processed with nested ____

loops

The elements in an array of objects are _____ by default

null

The index of two-dimensional arrays are sometimes called _____ and ______

rows, columns

Array index out of bounds errors are caught at ______

run time

Parallel arrays can be used to represent a _____ of information

table

arrayname[index]

(Array) How do you access a specific element?

T/F: Simple assignment of one array variable to another causes the data elements to be copied to a brand new array

False

T/F: The first index position in an array is 1.

False

T/F? A loop should continue until the array index variable is greater than the array's length.

False

True or false? In an array named "array1", consisting of 50 items, the last item in the array could be initialized to a value of 50 with the statement " array1[50]=50; "

False

True or false? Java allows the use of mixed data types within an array, which means item 1 in the array could be an int valued, while item 2 could be a char value.

False

arrayname.length

How do you find the length of an array?

index that doesn't exist

Index Out of Bounds Error

T/F: A method should accept an array parameter of any length

True

T/F: An Array named " table1 " that will hold 3 rows and 10 columns of data could be declared by the statement, int [] [] table1 = new int [3] [10]

True

T/F: Because an array is an object, it is possible for two variables to point to the same physical array

True

True or false? An array can be declared for any primitive data type, or for any reference data type

True


Kaugnay na mga set ng pag-aaral

Investigating Science - Module 7

View Set

Chapter 56 - Management of Patients with Dermatologic Disorders

View Set

Chapter 15.3-15.4 Connect Questions

View Set

12/2021 OK Insurance Adjuster License Exam

View Set

Chapter 10. Performance Measurement in Decentralized Organizations

View Set