Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 848223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:54:34+00:00 2026-05-15T06:54:34+00:00

in programming there is often such tasks walk through in multi dimensional array (for

  • 0

in programming there is often such tasks walk through in multi dimensional array (for simplify let take two dimensional) i need indexes of elements in two dimensional array like
left to right bottom to up and vice versa and so on please give me a few examples

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:54:35+00:00Added an answer on May 15, 2026 at 6:54 am

    The length of an array arr, in Java, is always arr.length. In Java, multidimensional arrays are nothing but array of arrays, so you can successively take the .length of any “sub-arrays”.

        int[][] m = {
            { 1, 2, 3, },
            { 4, 5, },
            { 6, 7, 8, 9, 10 },
        };
        for (int i = 0; i < m.length; i++) {
            for (int j = 0; j < m[i].length; j++) {
                System.out.printf("m[%d][%d] = %d%n", i, j, m[i][j]);
            }
        }
    

    The above prints:

    m[0][0] = 1
    m[0][1] = 2
    m[0][2] = 3
    m[1][0] = 4
    m[1][1] = 5
    m[2][0] = 6
    m[2][1] = 7
    m[2][2] = 8
    m[2][3] = 9
    m[2][4] = 10
    

    To represent matrices, it’s best to attach to the data structure (arrays or not) two indices M and N, which is the dimension of the matrix, and iterate on indices in terms of M and N instead of array .length. This higher abstraction would lead to better readability.

    See also

    • Java Tutorials/Arrays
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I do a lot of heavy math programming. Often there is a need to
I read many articles comparing programming languages. There is a word that comes often:
Benefits of C++11 std::array s when programming have been explained by experts, but there
Let us take this example scenario: There exists a really complex function that involves
When programming a big project, you often need the same pieces of code in
In the various programming projects I often work on, there are various levels of
In Karl Seguin's Foundations of Programming there is a small section on using the
In many programming languages there is the basic equals operator which will see if
On page 7 of Apple's Local and Push Notification Programming Guide there is a
Is there any programming language (or type system) in which you could express the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.