A
A
Anton @ Lyalin2016-12-01 19:42:38
Java
Anton @ Lyalin, 2016-12-01 19:42:38

Is it possible to display a matrix using foreach ???

If possible, how to arrange it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
al_gon, 2016-12-01
@toxa_1995

public class EntryPoint {
  public static void main(final String[] args) {
    final int numbers[][] = new int[][] { { 1, 2, 3 }, { 3, 2, 1 }, { 2, 3, 1 } };
    Stream.of(numbers).map(Arrays::toString).forEach(System.out::println);
  }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question