호그와트

panda's attack

영웅*^%&$ 2023. 11. 17. 04:12
728x90
public class RaggedArray {
    public static boolean finding(Integer[][] array) {
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                if (array[i][j] == null || array[i][j] == 0) {
                    System.out.print("false ");
                } else {
                    System.out.print("true ");
                }
            }
            System.out.println(); // Move to the next line after each row
        }
        return true;
    }

    public static void main(String[] args) {
        // Declare and initialize a 2D Integer array with 3 rows and 4 columns
        Integer[][] array1 = new Integer[3][4];

        // Assign values to specific locations in the array
        array1[0][0] = 2;
        array1[0][1] = 5;
        array1[0][2] = 4;
        array1[0][3] = null; // Assigning null
        array1[1][0] = 6;
        array1[1][1] = 3;
        array1[1][2] = null; // Assigning null
        array1[1][3] = null; // Assigning null
        array1[2][0] = 9;
        array1[2][1] = 7;
        array1[2][2] = 1;
        array1[2][3] = 5;

        // Display the actual 2D array using a for loop
        System.out.println("Displaying the elements of array1 (for loop): ");
        for (int i = 0; i < array1.length; i++) {
            for (int j = 0; j < array1[i].length; j++) {
                if (array1[i][j] == null) {
                    System.out.print("null ");
                } else {
                    System.out.print(array1[i][j] + " ");
                }
            }
            System.out.println();  // Move to the next line after each row
        }

        // Existing logic for row_num and col_num can be kept here

        finding(array1);
    }
}

 

오히려 프로그래밍을 하면할수록 겸손해지는 거 같다 
정말 당연한 것들, 기본적인 것들, 다 안다고 생각했던 것들을 실전 어플리케이션을 만들면서 또 새로운 문제들을 풀고 도전하면서 다시 새롭게 배우게 된다.. 정말 놀랍다 


하느님, 공부하면 할수록 연구하면 할수록 제가 모르는 것들이 참으로 많다는 것을 배우게 됩니다 
저는 여기서 이렇게 공부할 수 있는 이 과정이 그저 놀랍고 감사할 뿐입니다. 
제가 이 하루에 최선을 다할 수 있게 허락하소서 
감사합니다 가장 높으신 분이시여 

728x90