Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to give names to row and column of a 2D array in Java?

Tags:

java

arrays

I google it before, the answer was no but I wonder if there is any possible way.

Is there a way to give names to row and column of a 2D array in Java?

like image 758
macaugmxus Avatar asked Dec 09 '22 14:12

macaugmxus


1 Answers

No you can't. 2D array is just array of arrays. You'll need to have 2 other arrays with names for columns and rows

Probably you can use something different (another data structure like Map) if you need to.

like image 58
Tala Avatar answered Dec 11 '22 04:12

Tala