Java String/array FAQ: How do I create an array of Strings in Java (i.e., a Java String array)?
I wrote this article because I can never remember the Java array syntax myself, so I use this page as a reference. There are a couple of ways of declaring and using Java String arrays, and I'll try to cover those in this article.
1) Declaring, sizing, and using a Java String array
The first way to use a Java String array is to (a) declare it in one step, and then (b) use it in a second step. Within a class, you declare a Java String array like this: