Over a million developers have joined DZone.

Java Quiz 18: Multidimensional Arrays

DZone's Guide to

Java Quiz 18: Multidimensional Arrays

Let's take a look at the answer to our last quiz (dealing with Arrays) before jumping into this week's puzzle, which tackles working with multidimensional Arrays.

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

Before we start with this week's quiz, here is the answer to Java Quiz 17: Working With Arrays

The expression to the left of the brackets is fully evaluated before any part of the expression within the brackets is evaluated.

  1. We can simplify the statement System.out.print(arrA[(arrC = arrB)[(arrA = arrC)[4]]]); as System.out.print(arrA[arrB[arrB[4]]]);.
  2. arrB[4] = 5, arrB[5] = 4. arrA[4] = 6

The correct answer is: B.

Here Is the Java Puzzle for Today!

Write one statement on line 11 to print the element with the value of 18 to the standard output.

public class MyArray
    public static void main(String[] args)
        int[] array[][] = {
            {{1, 2, 3, 4, 5}},
            new int[3][],
            {{6, 7, 8, 9, 10, 11}, {12, 13, 14, 15}, {16, 17, 18, 19}}
        // line 11: Write your statement here!

The correct answer and its explanation will be included in the next quiz in two weeks! For more Java quizzes, puzzles, and assignments, take a look at my site!

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. 

java ,multidimensional arrays ,java quiz ,arrays

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}