Problem with casting.

(int) Math.random() * 6
should be
(int) (Math.random() * 6)

Similar correction for the other one.
What happened in your case was that random() which is between 0.0 and...