Multidimensional Arrays lengths in Java

0 votes
How can I determine the lengths of a multidimensional array where the indices are not equal? For example, this is what I have

int[][] pathList = new int[6][4]

I need to locate the numbers "6" and "4" without really hard-coding the indices.

I can find 6 using pathList.length, but how to do the same with 4?
Aug 8, 2022 in Java by krishna
• 2,820 points
364 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In Java

0 votes
2 answers

How to concatenate two arrays in Java?

public <T> T[] concatenate(T[] a, T[] b) ...READ MORE

answered Jul 19, 2018 in Java by Sushmita
• 6,920 points
2,738 views
+1 vote
1 answer

Are arrays equivalent to objects in Java ?

Yes; the Java Language Specification writes: In the Java ...READ MORE

answered May 10, 2018 in Java by Rishabh
• 3,620 points
1,253 views
0 votes
1 answer

Arrays are passed by value or passed by reference in Java?

Arrays are not a primitive type in ...READ MORE

answered Jul 18, 2018 in Java by sophia
• 1,400 points
10,249 views
0 votes
0 answers

Returning arrays in Java

I am trying to return an array ...READ MORE

Aug 11, 2022 in Java by krishna
• 2,820 points
487 views
0 votes
0 answers

How do I fill arrays in Java?

Is there a proper way to fill ...READ MORE

Aug 12, 2022 in Java by krishna
• 2,820 points
502 views
0 votes
0 answers

How are arrays implemented in java?

In Java, arrays are implemented as objects, ...READ MORE

Aug 18, 2022 in Java by krishna
• 2,820 points
526 views
0 votes
0 answers

Matrix multiplication using arrays

Utilizing multidimensional arrays, I'm attempting to create ...READ MORE

Aug 5, 2022 in Java by krishna
• 2,820 points
553 views
0 votes
0 answers

Arrays.fill with multidimensional array in Java

Without using a loop, how can I ...READ MORE

Nov 16, 2022 in Java by Ashwini
• 5,430 points
581 views
0 votes
2 answers

How an object array can be converted to string array in java?

System.arraycopy is the most efficient way, but ...READ MORE

answered Aug 8, 2018 in Java by Sushmita
• 6,920 points
5,486 views
0 votes
2 answers

How does random shuffling of an array

Here is a simple way using an ArrayList: List<Integer> ...READ MORE

answered Nov 2, 2018 in Java by Sushmita
• 6,920 points
863 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP