I've been having problems generating a series of five random numbers that I store into an integer array. My problem is that I don't know how to ensure that each random number is unique and not a duplicate of another within the array.

I'm trying this now with picking random numbers between 1 & 5 so at least that way, I can tell if I am getting duplicates within that range, in the hope that the array wil have store all numbers 1,2,3,4,5 just to prove that these numbers are chosen randomly, and without duplication.

Currently, I'm getting 2, 2, 4, 5, 1 , or whatever.

Any ideas or code out there that can help?