I need to get the length of a 2D array for both the row and column. I’ve successfully done this, using the following code:
public class MyClass {
public s
There's not a cleaner way at the language level because not all multidimensional arrays are rectangular. Sometimes jagged (differing column lengths) arrays are necessary.
You could easy create your own class to abstract the functionality you need.
If you aren't limited to arrays, then perhaps some of the various collection classes would work as well, like a Multimap.