this evaluates to FALSE TRUE ,because matrix the first class is not array and array the second class is array.
vice versa for testing if class(die)=="matrix")
In other words, its a coincidence, matrix is the first class entry, array is the 2nd. you are indexing into the array/matrix with these numbers, and get parts of the array/matrix that correspond to those numbers, but this does not signify membership of parts of the array/matrix to the respective classes.
Going a little deeper, this is a good example of it being problematic practice to use the string based results of class(x) to understand whether an object is or isnt a class member. Often its way better in your programming to use an is.y(x) style function to answer that for you in a binary way.
is.array(die)
is.matrix(die)