What is the output of the following?
public class Main { public static void main(String[] args) { String[][] listing = new String[][] { { "A" }, { "B", "29.99" } }; System.out.println(listing.length + " " + listing[0].length); } }
A.
This array has two elements, making listing.length output 2.
While each array element does not have the same size, this does not matter because we are only looking at the first element.
The first element has one.
This makes the answer Option A.