66.5k views
2 votes
How would you create a 2D array of Strings called paintSwatches that holds the paint manufacturer, paint color name and the paint collection name (in that order) for each of the 60,000 paint swatches a store carries

User Alphageek
by
8.3k points

1 Answer

5 votes

Answer:

String[][] paintSwatches = new String[6000][3];

Step-by-step explanation:

The two-dimensional array is a data structure that holds and locates data in rows and columns. It is denoted by two square brackets after the data type when declaring the array.

The two-dimensional array "paintSwatches" would have 6000 rows and one column each of paint manufacturer, paint color name and paint collection name (that is, 3 columns).

User George Wood
by
8.1k points

Related questions

1 answer
3 votes
55.6k views
asked Mar 25, 2024 140k views
Newday asked Mar 25, 2024
by Newday
8.4k points
1 answer
5 votes
140k views