A string array is commonly used for:

a. Command-line arguments.
b. Storing an extremely long string.
c. Storing multiple copies of the same string.
d. Displaying floating-point numbers to the screen.


a. Command-line arguments.

Computer Science & Information Technology

You might also like to view...

Answer the following statements true (T) or false (F)

1) To add an item to a ListBox use the Add method of the Items property. 2) To remove an item from a ListBox, use the Delete method of the Items property. 3) The SelectedIndex property returns the index of the selected item. 4) If the user has not selected any items from the ListBox then SelectedIndex returns 0.

Computer Science & Information Technology

A ring is said to be _________ if it satisfies the condition ab = ba for all a, b in R.

A) ?cyclic ? B) ?commutative ? C) ?abelian ? D) ?infinite

Computer Science & Information Technology

Develop an application that generates a random number and prompts the user to guess the number (Fig. 15.26). When the user clicks the New Game JButton, the application chooses a number in the range 1 to 100 at random. The user enters guesses into the Guess: JTextField and clicks the Enter JButton. If the guess is cor- Tutorial 15 Craps Game Application 317 rect, the game ends, and the user can start a new game. If the guess is not correct, the application should indicate if the guess is higher or lower than the correct number.


a) Copying the template to your working directory. Copy the C:Examples Tutorial15ExercisesGuessNumber directory to your C:SimplyJava directory.
b) Opening the template file. Open the GuessNumber.java file in your text editor.
c) Creating a Random object. In line 28, create two instance variables. The first variable should store a Random object and the second variable should store a randomly gener- ated number in the range 1 to 100 created using the Random object.
d) Adding code to the enterJButtonActionPerformed method. Add code starting in line 133 to the enterJButtonActionPerformed method that retrieves the value entered by the user in guessJTextField and compares that value to the randomly generated number. If the user’s guess is lower than the correct answer, display Too low... in resultJTextField. If the user’s guess is higher than the correct answer, dis-
play Too high... in resultJTextField. If the guess is correct, display Correct! in resultJTextField. Then disable

Computer Science & Information Technology

Suppose that x is an int variable. Which of the following expressions always evaluates to true?

A. (x > 0) || ( x <= 0) B. (x >= 0) || (x == 0) C. (x > 0) && ( x <= 0) D. (x > 0) && (x == 0)

Computer Science & Information Technology