What are three ways you can use the square brackets [ ] with an array name?

What will be an ideal response?


First, the square brackets can be used to create a type name, such as double[] score. Second, the square brackets can be used with an integer value as part of the special syntax Java uses to create a new array, as in score = new double[5]. The third use of square brackets is to name an indexed variable of the array, such as score[1].

Computer Science & Information Technology

You might also like to view...

What is the code for a loop that iterates from the end of a string toward the beginning?

a. string::reverse_iterator i = s.begin() while ( i != s.end() ) { cout << *i; ++i; } b. string::reverse_iterator i = s.rbegin() while ( i != s.rend() ) { cout << *i; ++i; } c. string::reverse_iterator i = s.end() while ( i != s.begin() ) { cout << *i; --i; } d. string::reverse_iterator i = s.rbegin() while ( i != s.rend() ) { cout << *i; --i; }

Computer Science & Information Technology

Match each of the following writing markup views to their uses:

I. Simple Markup II. All Markup III. No Markup IV. Original A. Displays the final version of the document with all the markups and comments B. Minimizes the clutter of multiple comments by showing only those that are chosen C. Shows the initial version of a document and hides all markups D. Displays the final version of the document and does not show any markups or comments

Computer Science & Information Technology

A(n) ________ is a set of values that Excel saves and can substitute automatically in your worksheet

Fill in the blank(s) with correct word

Computer Science & Information Technology

Rather than returning a value, a method can signal its client by

a. Crashing the program b. Beeping c. Throwing an exception d. Ignoring the requested record

Computer Science & Information Technology