About 133,000 results
Open links in new tab
  1. The best way to print a Java 2D array? - Stack Overflow

    You can print in simple way. Use below to print 2D array. int[][] array = new int[rows][columns]; System.out.println(Arrays.deepToString(array)); Use below to print 1D array. int[] array = new …

  2. java - How to print a two dimensional array? - Stack Overflow

    Jun 23, 2020 · When the pen is down the individual array location, for instance [3][4] is marked with a "1". The last step of my program is to print out the 20/20 array. I can't figure out how to …

  3. How to print Two-Dimensional Array like table - Stack Overflow

    Pretty print 2D array in Java. 13. How to Loop and Print 2D array using Java 8. 2.

  4. How to Loop and Print 2D array using Java 8 - Stack Overflow

    May 6, 2015 · Using the classic way, if we want to access each element of a two dimensional array, then we need to iterate through two dimensional array using two for loops. for (String[] a …

  5. Pretty print 2D array in Java - Stack Overflow

    Jul 8, 2012 · Pretty print 2D array in Java. Ask Question Asked 12 years, 10 months ago. Modified 1 year, 3 months ago.

  6. java - Printing out a 2D array in matrix format - Stack Overflow

    I prefer using enhanced loop in Java. Since our ar is an array of array [2D]. So, when you iterate over it, you will first get an array, and then you can iterate over that array to get individual …

  7. What's the simplest way to print a Java array? - Stack Overflow

    We could have used Arrays.toString(array) to print one dimensional array and Arrays.deepToString(array) for multi-dimensional arrays. Java 8. Now we have got the option …

  8. java - Print multi-dimensional array using foreach - Stack Overflow

    Jun 7, 2016 · Your loop will print each of the sub-arrays, by printing their address. Given that inner array, use an inner loop: for(int[] arr2: array1) { for(int val: arr2) System.out.print(val); } Arrays …

  9. How to print two dimensional array of strings as String

    IMPORTANT2: since in this case you plan to append many things to the StringBuffer it's good to estimate a capacity to avoid allocating and relocating the array many times during appends, …

  10. printing a 2 dimensional array of objects in java - Stack Overflow

    Jan 30, 2012 · you need to use toString, and make sure the instances in the 2d array implement it appropriately. In your inner most loop something like Human current = cells[row][col]; // …

Refresh