Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

20 easy java questions! Thanks to whomever helps me! 1. An array is a list of data items that _____. a. all have different names

20 easy java questions! Thanks to whomever helps me!

1. An array is a list of data items that _____.

a. all have different names
b. all are integers
c. all have the same type
d. all are null

2. When you declare an array, _____.

a. you cannot reserve memory for it in the same statement
b. you might reserve memory for it in the same statement
c. the ability to reserve memory for it in the same statement depends on the type of the array

d. you always reserve memory for it in the same statement

3.

You reserve memory locations for an array when you _____.

a. use the keyword new
b. use the keyword mem
c. explicitly store values within the array elements

d. declare the array name

4.

The _____ field contains the number of elements in the array.

a. size
b. length
c. elements

d. capacity

5.

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

a. character
b. String
c. int

d. double

6.

The _____ allows you to cycle through an array without specifying the starting and ending points for the loop control variable.

a. enhanced for loop
b. select loop
c. do while loop

d. forevery loop

7.

To construct an array of objects using a default constructor, you must call the constructor using the keyword new for_____.

a. each declared array element
b. None of the above.
c. only the array itself, not the individual elements

d. only the first element

8.

In a _____, you commonly compare a value to the low or high endpoint of each of a series of numerical ranges, but not to the midpoint.

a. range match
b. range check
c. value match

d. array comparison

9.

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

a. null
b. nada
c. nil

d. void

10.

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

a. also must give the array a size explicitly
b. must make all the values zero, blank, or false
c. must make certain each value is different from the others

d. do not explicitly give the array a size

11.

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

a. only the first six
b. only the last one
c. all of them

d. only the first one

12.

A variable that holds a value as an indicator of whether some condition has been met is known as a(n) _____.

a. sentinel
b. constant
c. accumulator

d. flag

13.

A(n) _____ of an object is an instance variable or field.

a. method
b. property
c. behavior

d. attribute

14.

Providing values for all the elements in an array is called _____.

a. populating the array
b. finalization
c. defining the array

d. assignment

15.

A parallel array is one that _____.

a. holds an even number of values
b. is placed adjacent to another array in code
c. holds values that correspond to those in another array

d. is placed adjacent to another array in memory

16.

In which of the following situations would setting up parallel arrays be most useful?

a. You need to look up an employee's ID number to find the employee's last name.
b. You need to determine the shortest distance between two points on a map.
c. You need to store a list of 20 commonly misspelled words.

d. You need to calculate interest earned on a savings account balance.

17.

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

a. a copy of the value in the element
b. the address of the array
c. the address of the element

d. a copy of the array

18.

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

a. osmosis
b. reference
c. address

d. value

19.

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

a. a copy of the array
b. the address of the array
c. a copy of the first element in the array

d. nothing

20.

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

a. A Java method cannot return an array
b. the return type in the method header is followed by square brackets
c. the return type in the method header is preceded by an ampersand
d. the method's return type must match its parameter type

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Third International Conference Achids 2011 Daegu Korea April 2011 Proceedings Part 2 Lnai 6592

Authors: Ngoc Thanh Nguyen ,Chong-Gun Kim ,Adam Janiak

2011th Edition

3642200419, 978-3642200410

More Books

Students also viewed these Databases questions

Question

__________ are a basic application of our values.

Answered: 1 week ago

Question

describe the main employment rights as stated in the law

Answered: 1 week ago