Set red 2d array values using for loop

后端 未结 3 403
别那么骄傲
别那么骄傲 2021-01-27 19:13

I am trying to create a method that will get all of the red values in an image and display only the red values. I am having trouble with my getRedImage() method. I am new to thi

3条回答
  •  醉话见心
    2021-01-27 19:29

    Looping in 2d array is easy But i don't think this is the right way.

    private int[][] red = new int[1000][1000];
    
    for (int i = 0; i < 1000; i++) {
        for(int j = 0; j < 1000; j++) {
            System.out.println(red[i][j]);
        }
    }
    

提交回复
热议问题