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 OverflowW3Schools
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.
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
04:55
How to Print a String Array Using Java - YouTube
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
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.
Shahucollegelatur
shahucollegelatur.org.in › Department › Studymaterial › sci › compsci › Array and String-converted new.pdf pdf
Arrays and String
Java String array is basically an array of objects.
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.
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" };
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"};
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.