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 OverflowGeeksforGeeks
geeksforgeeks.org โบ java โบ string-arrays-in-java
String Arrays in Java - GeeksforGeeks
October 2, 2025 - ... // Java program to demonstrate various // methods to iterate over a string array public class GFG { public static void main(String[] args) { String[] arr = { "Apple", "Banana", "Orange" }; // First method for (String i : arr) { ...
W3Schools
w3schools.com โบ java โบ java_arrays.asp
Java Arrays
Java Examples Java Videos Java Compiler Java Exercises Java Quiz Java Code Challenges Java Practice Problems Java Server Java Syllabus Java Study Plan Java Interview Q&A ... Arrays are used to store multiple values in a single variable, instead of 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 strings.
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
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
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
So why aren't strings considered arrays?
Strings are character arrays in most languages... More on reddit.com
11:03
Check If a Value is Present in an Array in Java - GeeksforGeeks
25:51
Array & String in java | DSA - YouTube
03:40
Making an Array Of Strings | Java For Beginners - YouTube
12:16
Java Tutorial - 14 - Arrays of Strings - YouTube
08:32
String Array Example - YouTube
04:32
Learn Java - Exercise 14x - Using Arrays of Strings in Java - YouTube
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
Hereโs a complete source code example that demonstrates the syntax prior to Java 5: public class JavaStringArrayTests1 { private String[] toppings = {"Cheese", "Pepperoni", "Black Olives"}; // our constructor; print out the String array here public JavaStringArrayTests1() { // old `for` loop ...
Top answer 1 of 3
2
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.
2 of 3
0
these two are right too String[][] array = {emptyArr, filledArr, moreFilledArr};
String[][] array = new String[][] {emptyArr, filledArr, moreFilledArr};
please do check these too
Docs for Array in Java Have a Look for more clarification
tutorial of array 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
Java Code Geeks
examples.javacodegeeks.com โบ home โบ java development โบ java basics โบ arrays
Java String Array Example
November 9, 2023 - Finally, letโs see the ... args[]) { String[][] schoolbagArray = new String[4][2]; schoolbagArray[0] = new String[] {"Pens", "Pencils"}; schoolbagArray[1] = new String[] {"Books", "Notebooks"}; System.out.println( ...
Centron
centron.de โบ home โบ tutorials โบ java string array - tutorial
Java String Array - Tutorial โ centron
March 1, 2024 - String array is very common in simple Java programs, especially among beginners to Java and to test some specific scenarios. Even the Java main method argument is a string array - public static void main(String[] args). So today, we will look into different aspects of the Java string array with example programs.
Top answer 1 of 5
170
You could do something like this
String[] myStrings = { "One", "Two", "Three" };
or in expression
functionCall(new String[] { "One", "Two", "Three" });
or
String myStrings[];
myStrings = new String[] { "One", "Two", "Three" };
2 of 5
7
By using the array initializer list syntax, ie:
String myArray[] = { "one", "two", "three" };
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: In this example, we loop through the fruits array and append each element to the StringBuilder with a space as a delimiter. The if condition ensures that no extra space is added after the last element.
TutorialsPoint
tutorialspoint.com โบ string-arrays-in-java
String Arrays in Java
May 5, 2023 - As discussed earlier, we can see that ?st1_arr? is initialized with ?null? value. All the indexes of this string array contains ?null? only. We can access all the elements by iterating through the given array using iterative approaches like for, for each and while loop.
GeeksforGeeks
geeksforgeeks.org โบ java โบ java-program-to-convert-string-to-string-array
Java Program to Convert String to String Array - GeeksforGeeks
July 23, 2025 - ... // Java Program to Convert ... string to be convert to string array String str = "Geeks for Geeks"; String strArray[] = str.split(" "); System.out.println("String : " + str); System.out.println("String array : [ "); // ...