What do you need help with? the java part or the rotation part? Post what you have.
my first thought is you're trying to rotate a 2D array, but you said math. are you referring to a rotation matrix to rotate a vector x degrees/radians? or just changing the spots of a 2D array? Regardless, post your code/pseudocode.