Is it possible to print a 2-D array using enhanced for loop in java? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 2

Is it possible to print a 2-D array using enhanced for loop in java?

11th Jun 2020, 11:53 AM
Dipesh Das
Dipesh Das - avatar
1 Réponse
+ 3
int[][] array = {{1,2,3},{4,5,6},{7,8,9}}; for (int[] row : array) for (int num : row) System.out.println(num);
11th Jun 2020, 1:30 PM
zemiak