Question

To initialize a String array names to store the three Strings Huey, Duey and Louie, you would do String[ ] names = {Hu
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer : String[] names = {"Huey", "Duey", "Louie"};

Explanation :

Inorder to declare the string array we use " [ ] ", which are the subscript notations, we dont mention the size inisde the subscript while initializing any arrays.

Add a comment
Know the answer?
Add Answer to:
To initialize a String array names to store the three Strings "Huey", "Duey" and "Louie", you...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • /**    Given a String and an array of two Strings,    return a three String...

    /**    Given a String and an array of two Strings,    return a three String array containing the strings in alphabetical order.    Note: Capital letters count    sort3Strings("wallace", {"washington", "irving"}) -> {"irving", "wallace", "washington"}    sort3Strings("wallace", {"washington", "Irving"}) -> {"Irving", "wallace", "washington"}    sort3Strings("Washington", {"irving", wallace"}) -> {"Washington", "irving", "wallace"}    sort3Strings("washington", {"washington", "Washington"}) -> {"Washington", "washington", "washington"} **/ public static String[] sort3Strings(String stringValue, String[] stringArray) {    //your code here    return new String[1]; }//end sort3Strings   ...

  • Lab 2: (one task for Program 5): Declare an array of C-strings to hold course names,...

    Lab 2: (one task for Program 5): Declare an array of C-strings to hold course names, and read in course names from an input file. Then do the output to show each course name that was read in. See Chapter 8 section on "C-Strings", and the section "Arrays of Strings and C-strings", which gives an example related to this lab. Declare the array for course names as a 2-D char array: char courseNames[10] [ 50]; -each row will be a...

  • Huey, Dewey and Louie are triplets.  They are 25 years old and are trying to set up...

    Huey, Dewey and Louie are triplets.  They are 25 years old and are trying to set up savings plans for themselves.  They plan to retire at age 65.  They each have different ideas.  All APR’s are 4%. Huey’s plan:  deposit $100 each month into the account and leave the money in the bank until he retires at age 65.   Dewey’s plan:  Dewey doesn’t want to be bothered with monthly payments like Huey. He wants to hang onto his money throughout the year, and then make just...

  • 1. Write a program to input a list of names (strings) from the user and store...

    1. Write a program to input a list of names (strings) from the user and store them in an ArrayList. The input can be terminated by entering the empty string or by entering the string “quit”. 2. Add further functionality to your program so that it searches the ArrayList to find the first string and the last string according to dictionary ordering and then prints out these strings (names). Do this exercise without sorting the names in the ArrayList. For...

  • DESCRIPTION: You will be given a 1-D array, called wordFun, of Strings. The array has an...

    DESCRIPTION: You will be given a 1-D array, called wordFun, of Strings. The array has an unknown number of cells filled with data. As before, the array will already be filled with strings, some of which contain the string "Angela". You will create a method called countItUp which returns and integer array containing the number of times each of the letters in my name occur within the strings within this array. For example, if the input array was wordFun =...

  • DESCRIPTION: You will be given a 1-D array, called wordFun, of Strings. The array has an...

    DESCRIPTION: You will be given a 1-D array, called wordFun, of Strings. The array has an unknown number of cells filled with data. As before, the array will already be filled with strings, some of which contain the string "Angela". You will create a method called countItUp which returns and integer array containing the number of times each of the letters in my name occur within the strings within this array. For example, if the input array was wordFun =...

  • Storing the Array: Write an application that uses an Array to store 10messages of type String....

    Storing the Array: Write an application that uses an Array to store 10messages of type String. You will store this Array with 10 messages of your choosing. For example, a message could be “I love Java the programming language!” or another message could be “I love Java the drink!” Initializing the Array: You may initialize your Array with the messages or have the user enter the messages. The choice is yours. Your Java code will contain a method called shoutOutCannedMessage()...

  • Write the line that declares a two-dimensional array of strings named chessboard. That is, how would...

    Write the line that declares a two-dimensional array of strings named chessboard. That is, how would I declare a two-dimension array of strings that is called chessboard? You would declare a String array by saying " String []" correct? Now that's just a single array. How can I make that a two-dimension array? And how would I name it chessboard? Write the line that declare and creates a two-dimensional array of chars, tictactoe, with 3 rows, each with 3 elements...

  • Class DemoArray: 1. Create an array of type String , name it words, and initialize it...

    Class DemoArray: 1. Create an array of type String , name it words, and initialize it with the following words: one, two, three, four, five, four, three, two, one 2. Use a method of class Arrays to print the array. Make sure to use a label 3. At this point we are going to fix the misspelled word three. Use a loop to access the elements of the array. One by one check whether the current element happens to be...

  • using c only You will read in two strings from a file cp4in_1.txt at a time...

    using c only You will read in two strings from a file cp4in_1.txt at a time (there will be 2n strings, and you will read them until EOF) and then do the following. You alternately take characters from the two strings and string them together and create a new string which you will store in a new string variable. You may assume that each string is no more than 20 characters long (not including the null terminator), but can be...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT