It is returning your array with valid data in it. (Although I question the necessity of the curly braces after you instantiate your array, in which you populate the data.)
What you're likely doing is printing out the result of the call:
System.out.println(getLottoNumberGenerator());
That's not going to work; it'll print out the array's default toString
, which would look something like [I@827328
. Not helpful at all.
What you want to do instead is wrap that in a call to Arrays.toString()
.
System.out.println(Arrays.toString(getLottoNumberGenerator());