2.9k views
5 votes
Declare an array reference variable, week, and initialize it to an array containing the strings "mon", "tue", "wed", "thu", "fri", "sat", "sun" (in that order).

User Ajsharma
by
7.5k points

1 Answer

2 votes

Answer:

Following are the code.

//declaration of String data type array variable

String week[] = {"mon", "tue", "wed", "thu", "fri", "sat", "sun"};

Step-by-step explanation:

Following are the code that is implemented in the programming language:

  • Here, we declare the String data type array variable and assign values in it i.e., week and the following array hold only the same type of elements.
  • Array is the data type that holds the same type of elements at a time and it is also used as the data structure.
User Fefrei
by
7.5k points