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
🌐
W3Schools
w3schools.com › java › java_arrays.asp
Java Arrays
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; ... You can access an array element by referring to the index number.
🌐
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.
🌐
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.
🌐
DigitalOcean
digitalocean.com › community › tutorials › java-string-array
Java String Array: Declaration, Initialization & Examples | DigitalOcean
August 3, 2022 - Master Java String arrays with declaration, initialization, and manipulation examples. Learn iteration, sorting, searching, and conversion techniques.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › util › Arrays.html
Arrays (Java Platform SE 8 )
July 21, 2026 - If it is not sorted, the results are undefined. (If the array contains elements that are not mutually comparable (for example, strings and integers), it cannot be sorted according to the natural ordering of its elements, hence results are undefined.) If the array contains multiple elements equal to the specified object, there is no guarantee which one will be found.
Find elsewhere
🌐
Udemy
blog.udemy.com › home › it & development › software development › introduction to the string array: java tutorial
Introduction to the String Array: Java Tutorial - Udemy Blog
April 14, 2026 - A string array in Java is a data structure that stores multiple `String` values in a single, indexed collection. This article covers declaration, initialization, and traversal using both `for` and `for-each` loops.
🌐
Edureka
edureka.co › blog › string-array-in-java
Java String Array | String Array in Java with Examples | Edureka
July 5, 2024 - An array is a fundamental and crucial data structure Java programming language. It is highly used by programmers due to its efficient and productive nature. A Java String Array is an object that holds a fixed number of String values.
🌐
Jyotiprakash's Blog
blog.jyotiprakash.org › jyotiprakash's blog › #java › arrays, strings, and stringbuilder in java
Arrays, Strings, and StringBuilder in Java
December 18, 2024 - Parsing and Formatting Input/Output: ... dynamic output for reports or logs. Definition: An array is a fixed-size, contiguous collection of elements of the same data type....
🌐
CodeSignal
codesignal.com › learn › courses › mastering-complex-data-structures-in-java › lessons › understanding-and-using-arrays-in-java
Understanding and Using Arrays in Java
class ArrayExample { public String[][] createArrays() { String[] arrayLiteral = {"apple", "banana", "cherry"}; // Using array literals String[] fromConstructor = new String[] {"apple", "banana", "cherry"}; // Using constructor return new String[][] {arrayLiteral, fromConstructor}; } } public class Solution { public static void main(String[] args) { ArrayExample arrayExample = new ArrayExample(); String[][] arrays = arrayExample.createArrays(); System.out.println(String.join(", ", arrays[0])); // Output: apple, banana, cherry System.out.println(String.join(", ", arrays[1])); // Output: apple, b
🌐
Whitman College
whitman.edu › mathematics › java_tutorial › java › nutsandbolts › arraysAndStrings.html
Arrays and Strings
Like other programming languages, Java allows you to collect and manage multiple values through an array object. Also, you manage data comprised of multiple characters through a String object.
🌐
Software Testing Help
softwaretestinghelp.com › home › java › java string array- tutorial with code examples
Java String Array- Tutorial With Code Examples
April 1, 2025 - In this section, let’s see the various methods to add an element to the string array. In this method, you create an array having a larger size. For Example, if you have to store 5 elements in the array, then you will create an array with size 10. This way you can easily add new elements at the end of the array. An example that implements the addition of an element to the Pre-allocated array is shown below. import java.util.*; public class Main { public static void main(String[] args) { String[] colorsArray = new String[5]; // initial array values colorsArray[0] = "Red"; colorsArray[1] = "Gre
🌐
Oracle
docs.oracle.com › javase › tutorial › java › nutsandbolts › arrays.html
Arrays (The Java™ Tutorials > Learning the Java Language > Language Basics)
You can also declare an array of arrays (also known as a multidimensional array) by using two or more sets of brackets, such as String[][] names. Each element, therefore, must be accessed by a corresponding number of index values. In the Java programming language, a multidimensional array is ...
🌐
Runestone Academy
runestone.academy › ns › books › published › apcsareview › ArrayBasics › abasics.html
8.1. Arrays in Java — AP CSA Java Review - Obsolete
You can also initialize (set) the values in the array when you create it. In this case you don’t specify the size of the array, it will be determined from the number of values that you specify. int[ ] highScores = {99,98,98,88,68}; String[ ] names = {"Jamal", "Emily", "Destiny", "Mateo", "Sofia"};
🌐
Scaler
scaler.com › home › topics › string array in java
String Array in Java - Scaler Topics
April 28, 2024 - There are various methods for converting them from an array to a string. Let us discuss them one by one. Java's toString() method takes an array and returns its string representation.
🌐
TutorialsPoint
tutorialspoint.com › article › string-arrays-in-java
String Arrays in Java
May 5, 2023 - Once we create an array we can?t change its size i.e. it is of fixed length. The values are enclosed within double quotes. Strings are immutable in java, so string arrays are too.