array of arrays image button

how can you make an array of arrays image button in android studio and choose a random item from it?
someone gave me this format..but I don’t know what to do

Drawable[][] images = new Drawable[4][10];
fillArray();
int index = 0;
ImageButton button = new ImageButton(this);
button.setImageDrawable(images[index][(int)(Math.random()*10)]);
button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    index++;
        ((ImageButton)v).setImageDrawable(images[index][(int)(Math.random()*10)]);
    }
});