About 320,000 results
Open links in new tab
  1. Index of 2D array in java - Stack Overflow

    Is it possible to get the index of a 2D array? Suppose I have the following array int [] [] arr = { {41, 44, 51, 71, 63, 1}, {7, 88, 31, 95, 9, 6}, {88, 99, 6, 5, 77, 4}}; And I want to get the index...

  2. Java Multi-Dimensional Arrays - GeeksforGeeks

    Apr 23, 2025 · A 2-D array can be seen as an array storing multiple 1-D array for easier understanding. Syntax (Declare, Initialize and Assigning) // Declaring and Intializing data_type …

  3. 2D Array in Java – Two-Dimensional and Nested Arrays

    Aug 10, 2022 · We can access items in a two dimensional using two square brackets. The first denotes the array from which we want to access the items while the second denotes the index …

  4. Learn Java: Two-Dimensional Arrays Cheatsheet | Codecademy

    In Java, when accessing the element from a 2D array using arr[first][second], the first index can be thought of as the desired row, and the second index is used for the desired column.

  5. Two Dimensional Array in Java - Tutorial Gateway

    Using the index, we can access or alter/change every individual element present in a two dimensional array. An index value of a two dimensional array starts at 0 and ends at n-1 where …

  6. Two Dimensional Array In Java - JavaTutoring

    Apr 15, 2025 · Basically, you need to define both the rows and columns and then go ahead with declaring the elements in the respective locations or indexes. As you can see in the example …

  7. Find the Index of an Element in a Java Array | Baeldung

    Dec 7, 2023 · In this tutorial, we’ll discuss various methods, with code examples, for finding the index of an array element using both Java’s built-in APIs and a third-party library.

  8. Java- finding an index in a 2D array - Stack Overflow

    Oct 10, 2017 · I want to take a user's integer input and locate the index of the integer one less than the user's input. I have manually declared the first two columns in my array, and the …

  9. Find the Index of an Array Element in Java - GeeksforGeeks

    Dec 9, 2024 · One of the simplest and most straightforward ways to find the index of an element in an array is by using a loop. You can iterate through the array and compare each element …

  10. Two Dimensional Array In Java with Examples - Scaler Topics

    Jun 8, 2024 · In the case of 2D array in Java, we use row and column indices to access a particular element from the matrix. It has the following syntax: