ITP 120 - Java

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

Lenth

Each array in Java has a public field named ______ that contains the number of elements in the array.

0 through 14

If final int SIZE = 15 and int [ ] x = new int[SIZE], what would be the range of subscript values that count be used with x [ ]?

Final

It is common practice to use a ____ variable as a size declarator.

Array Bounds Checking

Java performs _____, which means that it does not allow a statement to use a subscript that is outside the range of valid subscripts for the array.

In memory, an array of string object

consists of elements, each of which is a reference to a string object.

An array of 6 values ranging from 0 through 5 and referenced by the variable x will be created

1. What will be the result of executing the following code? Int[] x = {0, 1, 2, 3, 4, 5};

An error will occur when the program runs

1. What will be the results of the following code? Final int ARRAY_SIZE = 5; Float[] x = float[ARRAY_SIZE]; For(int i = 1 <= ARRAY_SIZE; i44) { X[i] = 10.0; }

a reference to the string "ghi"

For the following code, what would be the value of str[2]?

0

By default, Java initializes array elements with what variable?

0

Subscript numbers always start with what value?

An array of float values

What will be returned from the following method? public static float [ ] getValue(int x)

An accompanying integer value that holds the number of items stored in the array

What do you normally use with a partially filled array?

Long [ ]

To return an array of long values from a method, use this as the return type for the method.

Subscript

What do you call the number that is used as an index to pinpoint a specific element within an array?


Kaugnay na mga set ng pag-aaral

Mastering Biology Chapter 42 (Cut)

View Set

Chapter 56: Care of Patients with Noninflammatory Intestinal Disorders

View Set

Body Fluid Differential Tutorial

View Set

UMKC Anchor 308 - ACM Code of Ethics Quizzes Combined

View Set

Chapter 20: Aggregate Demand and Aggregate Supply

View Set

Chapter 10 Helping others part 2

View Set