Problem printing an array
Hi people, I'm having little problem printing the resulting array in this simple program. Someone told me that the answer it was producing is the adress of the array and not the array itself, but i dont know how to get it right and print the array.
Here's the program.
Thanks.
public class TableauTest {
public static void main(String args[]){
int tableauInt[] = new int [10];
for (int i = 0; i < 10; i++){
double random = Math.random();
int partieEntiere = (int) (random * 20);
System.out.println(partieEntiere);
tableauInt[i] = partieEntiere;
}
System.out.println(tableauInt);
}
}
The goal is to put numbers from 0 to 20 in an array of 10.