I'm trying to randomly select 6 numbers for a lottery application. Then add the numbers to an array. When I try to display the information contained within the array, it returns [I@63376afa. If I display randomInt outside of an array it displays correctly, but that isn't added to an array. If I try to add randomInt to an array after the for loop has been processed I get an error Type mismatch can't convert int to int[] which makes sense.
import java.util.Random;
public class PracRandom1
{
public static void main(String[] args)
{
int randomInt=0;
int[] numArray = new int[randomInt];
int[] array = new int[5];
Random randomNum = new Random();{
for (int i = 0; i <= array.length; ++i){
randomInt = 1+randomNum.nextInt(6);
System.out.println("Array Random numbers: " + numArray);
}
}}}