About 339,000 results
Open links in new tab
  1. How to get a column from a 2D java array? - Stack Overflow

    I know that 2d arrays are arrays of arrays. To get a row you can do: rowArray = my2Darray[row] Since each row can be a different size, I'm assuming it's not built in to get a column from a 2D …

  2. java - Which comes first in a 2D array, rows or columns ... - Stack ...

    Jul 25, 2012 · When creating a 2D array, how does one remember whether rows or columns are specified first? Java specifies arrays similar to that of a "row major" configuration, meaning …

  3. get columns from two dimensional array in java - Stack Overflow

    May 25, 2015 · Here is a method using Java 8 streams: return IntStream.range(0, matrix.length) .map(i -> matrix[i][column]).toArray(); And if you want to cope with rows that are too short: …

  4. Java Multi-Dimensional Arrays - GeeksforGeeks

    Apr 23, 2025 · Multidimensional arrays are used to store the data in rows and columns, where each row can represent another individual array are multidimensional array. It is also known as …

  5. How to Retrieve Rows and Columns from a 2D Array Matrix in Java?

    Learn how to effectively extract rows and columns from a 2D array in Java with step-by-step explanations and code examples.

  6. Different Ways To Declare And Initialize 2-D Array in Java

    Nov 13, 2024 · row: The number of rows in an array; col: The number of columns in an array. When you initialize a 2D array, you must always specify the first dimension(no. of rows), but …

  7. Java Multi-Dimensional Arrays - W3Schools

    Multidimensional arrays are useful when you want to store data as a tabular form, like a table with rows and columns. To create a two-dimensional array, add each array within its own set of …

  8. 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. Just …

  9. How to Retrieve a Specific Column from a 2D Array in Java?

    Extracting a specific column from a 2D array in Java can be accomplished by iterating through each row of the array and collecting the elements of the desired column. This tutorial provides …

  10. Get Rows and Columns of 2D Array in Java - Online Tutorials …

    Learn how to get the number of rows and columns from a 2D array in Java with this comprehensive guide.

  11. Some results have been removed