You have forgotten to give the variable a name? Both of these work.

String[][] array = {emptyArr, filledArr, moreFilledArr};
String[][] array = new String[][] {emptyArr, filledArr, moreFilledArr};

I recommend you to go through the basic Java syntax specification and tutorials. Start with The Java Tutorials by Oracle Corp, free of cost.

Answer from Nikolas on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ java โ€บ string-arrays-in-java
String Arrays in Java - GeeksforGeeks
October 2, 2025 - So generally we have three ways to iterate over a string array. The first method is to use a for-each loop. The second method is using a simple for loop. And the third method is to use a while loop.
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ java-string-array
Java String Array: Declaration, Initialization & Examples | DigitalOcean
August 3, 2022 - Even java main method argument ... String array is basically an array of objects. There are two ways to declare string array - declaration without size and declare with size....
Discussions

How to create and initialise in Java an array of String arrays in one line? - Stack Overflow
please do check these too Docs ... with java docs , I had to add this as a comment but I couldn't, I want to extend with more resources mentioned above , Thanks ... We can also achieve it by initialising and assigning to a single dimensional array of type Object. Something like below. String[] filledArr ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
Java - How do I make a String array with values? - Stack Overflow
I know how to make an empty array, but how do I make a String array with values from the start? More on stackoverflow.com
๐ŸŒ stackoverflow.com
Java- Converting a string of numbers separated by spaces into an array?
You have the right idea. String.split() will return an array of strings. Then, if you want to treat any individual string in that array as an integer you can use Integer.parseInt() . If you want to create an array of integers, just make the array that way. More on reddit.com
๐ŸŒ r/learnprogramming
7
4
February 2, 2016
In Java, how do static arrays of Strings work? Strings are arrays of characters, so when the array of Strings is initialized with a given size, how does Java know how much memory to allocate?
It's really just an array of references (this means 32 or 64 bit addresses depending on the platform), no memory is allocated for the string objects. More on reddit.com
๐ŸŒ r/learnprogramming
9
1
December 16, 2022
๐ŸŒ
Hero Vired
herovired.com โ€บ learning-hub โ€บ blogs โ€บ string-array-in-java
String Array in Java: How to Declare, Example, Initializing
Finally, String Arrays in java ... it to a file. Declaring a String Array is simple; just use the square brackets and assign the values directly or from another source....
๐ŸŒ
W3Schools
w3schools.com โ€บ java โ€บ java_arrays.asp
Java Arrays
Java Examples Java Videos Java ... declaring separate variables for each value. To declare an array, define the variable type with square brackets [ ] : ... We have now declared a variable that holds an array of ...
๐ŸŒ
Software Testing Help
softwaretestinghelp.com โ€บ home โ€บ java โ€บ java string array- tutorial with code examples
Java String Array- Tutorial With Code Examples
April 1, 2025 - This tutorial on Java String Array explains how to declare, initialize & create String Arrays in Java and conversions that we can carry out on String Array.
๐ŸŒ
CodeGym
codegym.cc โ€บ java blog โ€บ java arrays โ€บ string array in java
String Array in Java
May 11, 2023 - Note that in all cases, you have to specify the type of the array (in this case, String) while declaring the variable. In Java you can iterate through a String array using a loop. It could be for or a foreach construction.
๐ŸŒ
Naukri
naukri.com โ€บ code360 โ€บ library โ€บ how-to-declare-string-array-in-java
How to Declare String Array in Java
July 23, 2025 - Almost there... just a few more seconds ยท <img src="https://www.naukri.com/akam/13/pixel_588cd50e?a=dD0xNGMwN2NhZDZkMDg5NTk0OGVkOTRhNWU2YTU1YTg3OWI3N2FiZmUwJmpzPW9mZg==" style="visibility: hidden; position: absolute; left: -999px; top: -999px;" />
Find elsewhere
๐ŸŒ
Whitman College
whitman.edu โ€บ mathematics โ€บ java_tutorial โ€บ java โ€บ nutsandbolts โ€บ arraysAndStrings.html
Arrays and Strings
Notice the use of arrayOfInts.length to retrieve the current length of the array. length is a property provided for all Java arrays. Arrays can contain any legal Java data type including reference types such as objects or other arrays. For example, the following declares an array that can contain ten String objects.
๐ŸŒ
Java2Blog
java2blog.com โ€บ home โ€บ core java โ€บ string โ€บ how to declare a string array in java
How to declare a String array in java - Java2Blog
April 15, 2021 - We can also declare a String array and can initialize it later. ... We can also use Java 8โ€™s setAll() method and pass a generator to initialize String array in java.
๐ŸŒ
Python Examples
pythonexamples.org โ€บ java โ€บ how-to-declare-a-string-array
How to Declare a String Array in Java
We declare a string array named stringArray using array literal syntax with predefined string values. We print the array elements to the console to demonstrate the initialization. import java.util.Arrays; // Declare and Initialize a String Array public class Main { public static void main(String[] ...
๐ŸŒ
Alvin Alexander
alvinalexander.com โ€บ java โ€บ java-string-array-reference-java-5-for-loop-syntax
Java String array examples (with Java 5 for loop syntax) | alvinalexander.com
As this example shows, Java arrays begins with an element numbered zero; they are zero-based, just like the C programming language. If you need a String array but donโ€™t initially know how large the array needs to be, you can declare an array variable without giving it an initial size, like this:
๐ŸŒ
JanbaskTraining
janbasktraining.com โ€บ home โ€บ what is java string? how to declare string array in java with example
What is Java String? How to Declare String Array in Java with Example
June 1, 2018 - Following are a few of the standard methods that are used to declare Java array: Just like integer arrays the String array is also declared by using square brackets. The square bracket that is used to declare the arrays can be put at two places ...
๐ŸŒ
Unstop
unstop.com โ€บ home โ€บ blog โ€บ string array in java | create, operations & more (+examples)
String Array In Java | Create, Operations & More (+Examples)
January 15, 2025 - Output (set code file name as StringArrayExample.java): ... We start by declaring a class named StringArrayExample with a main method, which serves as the entry point of the program.
๐ŸŒ
Board Infinity
boardinfinity.com โ€บ blog โ€บ string-array-in-java
String Array in Java | Board Infinity
August 20, 2025 - The string is only an object that represents a list of char values. In Java, strings are immutable. In Java, immutable refers to strings that cannot be changed. It is known as a String Array in Java when a String array is created. A String array must first be declared and initialized before it can be used.
๐ŸŒ
Edureka
edureka.co โ€บ blog โ€บ string-array-in-java
Java String Array | String Array in Java with Examples | Edureka
July 5, 2024 - Since there are only 3 elements in stringArray3, and the index starts from 0, the last index is 3. We could also use the formula (array length โ€“ 1) to ascertain the value of the index. On accessing an index greater than 2, an exception will be raised. ... This will throw a java.lang.ArrayIndexOutOfBoundsException. Initialization of a string array can be done along with the declaration by using the new operator in the syntax:
๐ŸŒ
iO Flood
ioflood.com โ€บ blog โ€บ java-string-array
How to Create and Manipulate Java String Arrays
February 27, 2024 - In Java, creating a string array is simple. You declare an array and initialize it with string values.
๐ŸŒ
Scaler
scaler.com โ€บ home โ€บ topics โ€บ string array in java
String Array in Java - Scaler Topics
April 28, 2024 - The above statement declares a string array of size five where arr is the name of the array and String is the data type for the array. However, you can also write the above declaration as - Both of the above declarations can be used. However, out of the three declarations, the first one is more efficient and is suggested for use. Initialization means to put a value into the variable. However, the data types in Java are, by default, initialized by their default values as soon as they are declared.
๐ŸŒ
Upgrad
upgrad.com โ€บ home โ€บ tutorials โ€บ software & tech โ€บ string arrays in java
String Array in Java โ€“ How to Declare, Initialize, Iterate, and Use
May 14, 2025 - Explanation: Here, you're declaring an array named colors that will store string values. At this stage, no memory is allocated, and no values are assigned โ€” that comes later. This step is important because Java is a statically-typed language, so you must define the type and structure of your variables beforehand.