How to Create a String Array

Note: The size of an array can't be modified. If you want a bigger array a new array needs to be instantiated

1. If you don't already have your Android project, create your project.

2. Open the MainActivity.java file and add the below line in your onCreate method.
This will define and initialize a single array named myArray.

String[] myArray = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};

3. Compile and test!

4. Another way to create it.
String[] myArray = new String[] { "January", "February", "March" }; 

5. Other useful String Arrays.

// Days of the Month
String[] myArray = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31"};

//Days of the Week
String[] myArray = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

Next Recommended Article: How to Create an ArrayAdapter

Resources: