Advertisement
Niloy007

Nested for each Loop

Nov 6th, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. package MidQuestionSolution.TwoZeroOneEight.Fall;
  2.  
  3. public class OneC {
  4. public static void main(String[] args) {
  5. int[][] arr = {{0}, {1, 2}, {3, 4, 5}, {6, 7, 8, 9}};
  6.  
  7. for(int[] x : arr) {
  8. for(int y : x) {
  9. System.out.print(y + " ");
  10. }
  11. System.out.println();
  12. }
  13. }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement