Takeaways on Jan 28 2024
Object[] anyArray = new Object[3]; ->Here, you initialize an array of object with the length of 3 anyArray[0] = new String[]{"a", "b", "c"}; anyArray[1] = new String[][]{ {"1", "2"}, {"3", "4", "5"}, {"6", "7", "8", "9"}}; anyArray[2] = new String[2][2][2]; System.out.println(Arrays.deepToString(anyArray)); - we use deepToString to print the entire array with nested dimensions public class ArrayExample { public static void main(String[] args) { Object[] anyArray = new Object[3]; System.out.println(Arrays.toString(anyArray)); anyArray[0] = new String[]{"a", "b", "c"}; System.out.println(Arrays.deepToString(anyArray)); anyArray[1] = new String[][]{ {"1", "2"}, {"3", "4", "5"},