Please help me how can I use a variable from **deviation\_2DArray.java**
into **NBC.java**, in **NBC.java** I want to average `b[i]` by `d[i][j]` and `c[j]`

Example: 

```
b[1]=avg (d[1][1]+d[1][2]+.....+d[1][5])

```

Thanks in advance.

**2DArray.java**

```
public class 2DArray {

    public static void main(String[] args) {

        double[][] d = new double[6][4];

        double[][] e = {
            {}, {
                0.0, 0.6, 0.0, 0.0
            }, {
                0.0, 0.2, 0.5, 0.1
            }, {
                0.0, 0.2, 0.5, 0.4
            }, {
                0.0, 0.2, 0.5, 0.7
            }, {
                0.0, 0.0, 0.0, 0.9
            }
        };

        double[] avg = new double[4];
        double[] sum = new double[4];
        int i, j, k;

        //average of column
        for (j = 1; j < e[1].length; j++) {
            for (i = 1; i < e.length; i++)
            System.out.println("e[" + i + "][" + j + "] = " + e[i][j]);
        }

        for (j = 1; j < e[1].length; j++) {

            sum[j] = 0.0;
            k = 0;
            for (i = 1; i < e.length; i++)

            if (e[i][j] > 0.0) {
                sum[j] += e[i][j];
                k++;
            }
            avg[j] = sum[j] / k;

            System.out.println("Average of j[" + j + "] = " + avg[j]);

        }

        for (j = 1; j < e[1].length; j++) {
            for (i = 1; i < e.length; i++)

            if (e[i][j] > 0.0) {

                d[i][j] = Math.abs(e[i][j] - avg[j]);
                System.out.println("d[" + i + "][" + j + "] = " + d[i][j]);

            }
        }

    }
}

```

**NBC.java**

```
public class NBC {
    public static void main(String[] args) {

        double[] b = new double[6];
        double[] c = new double[4];
        int count;

        b[i] = d[i][j] / count;
    }

}

```