needs help on my problem, I need to combine 3 array into one multidimensional array. but I always encounter error which some value return null. the data in first array (String[][]dataset) was:

```
001200700001        70        70        70        55        70        
        001200700002        70        70        60        60        60        
        001200700003        85        85        85        60        85        
        001200700004        60        70        85        70        85        
        001200700005        70        60        60        60        85  

```

data for String[][]predictiondata was:

```
 15        74.25        64.25        64.25        64.25        89.25        
 14        74.25        64.25        64.25        64.25        89.25 

```

and for Means[] was:

```
String[]Means={"Means","0","0","0","0","0"};

```

so here's my code so far and the error output:

```
public void hashtree(String[][]dataset, String[][]predictiondata){
        //======fetch data from database then add 1 morre row for calculation

        String[]Means={"Means","0","0","0","0","0"};

        int heightofarray = (dataset.length)+(predictiondata.length)+(Means.length);
        int lengthofarray=(dataset[0].length);
        System.out.println("heightofarray: "+heightofarray+" lengthofarray: "+lengthofarray);
        String[][]toCalculate = new String[heightofarray][lengthofarray];

        for(int a=0;a<dataset.length;a++){
            for(int b=0;b<dataset[0].length;b++){
                toCalculate[a][b]=dataset[a][b];
            }
        }
        for(int a=0;a<predictiondata.length;a++){
            for(int b=0;b<predictiondata[0].length;b++){
                toCalculate[(dataset.length)+a][b]=predictiondata[a][b];
            }
        }
        for(int a=0;a<Means.length;a++){
            toCalculate[heightofarray-1][a]=Means[a];
        }

        System.out.println("should print String[][]toCalculate");
        for(int a=0;a<toCalculate.length;a++){
            for(int b=0;b<toCalculate[0].length;b++){
                System.out.print(toCalculate[a][b]+"\t");
            }System.out.println("");
        }

```

The order for the new combined array ( String[][]toCalculate ) is: 

String[][]dataset 

String[][]predictiondata

String[]Means

but however I always get the output

```
System.out.println("should print String[][]toCalculate");
    001200700001        70        70        70        55        70        
    001200700002        70        70        60        60        60        
    001200700003        85        85        85        60        85        
    001200700004        60        70        85        70        85        
    001200700005        70        60        60        60        85        
    15        74.25        64.25        64.25        64.25        89.25        
    14        74.25        64.25        64.25        64.25        89.25        
    null        null        null        null        null        null        
    null        null        null        null        null        null        
    null        null        null        null        null        null        
    Exception in thread "main" java.lang.NullPointerException
    null        null        null        null        null        null        
    null        null        null        null        null        null        
    Means        0        0        0        0        0   

```

Thank you very much for the solving