About 3,120,000 results
Open links in new tab
  1. Java Input scanner to array multidimensional - Stack Overflow

    //defining 2D array to hold matrix data. int[][] matrix = new int[row][col]; // Enter Matrix Data. enterMatrixData(scan, matrix, row, col); // Print Matrix Data. printMatrixData(matrix, row, col); …

  2. java - User input to multi-dimensional array (column) - Stack Overflow

    Nov 15, 2012 · I have an array: [ 0 0 1 0 2 0 3 0 4 0 5 0 ] How do I specify where the user input (using scanner) will go to in the array? I would like to add an integer to each position of the …

  3. User input numbers into a 2 dimensional array in java

    Nov 18, 2016 · Essentially you need to use a nested for loop as stated above. I will provide you a basic template. for (int j = 0; j < width; j ++){ if (counter < userInput){ counter++; arr[i][j] = value; …

  4. How to Take Array Input From User in Java? - GeeksforGeeks

    Apr 17, 2025 · Arrays in Java are an important data structure, and we can add elements to them by taking input from the user. There is no direct method to take input from the user, but we can …

  5. Java Multi-Dimensional Arrays - GeeksforGeeks

    Apr 23, 2025 · Then create a nested loop to take input from user to add element in the multi-dimensional array. Then print the multi-dimensional array and close the scanner object. …

  6. How to Take User Input in Java 2D Array using Scanner | Create …

    Nov 7, 2022 · In this article, we are going to learn how to take user input using scanner and print a two dimensional array. first we declare and initialize 2D ...

  7. Java MultiDimensional Arrays - JavaTechNote

    There are following step to create Multidimensional Arrays. Create Scanner class to enter user input. Declare the size of Multidimensional Arrays. Use sc.nextInt () method to enter number of …

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

  9. Scanner in Array Java: How to Read User Input into an Array

    In this comprehensive guide, we will show you how to use scanners to read data into arrays in Java. We will start by discussing the basics of arrays and scanners. Then, we will show you …

  10. MultiDimensional Arrays In Java (2d and 3d Arrays In Java)

    Apr 1, 2025 · Java MultiDimensional Arrays. We have already seen Two-dimensional arrays. Java supports arrays with more than two dimensions. The general syntax of a multi-dimensional …

  11. Some results have been removed
Refresh