I'm pretty new to java so I apologize if this is a dumb question but I've been starting from the basics and building up. I've gotten into arrays recently from a tutorial and I had them working in different instances but now they don't seem to output the correct values. Here's my code:
import java.util.Random;
class mainstart {
public static void main (String[] args) {
Random rand = new Random();
int freq[]=new int[7];
for(int roll = 0; roll<1000; roll++){
++freq[1+rand.nextInt(6)];
}
System.out.println("Face\tFrequency");
for(int face=1;face<freq.length;face++){
System.out.println(face + "\t" + freq);
}
}
}
This program is supposed to roll a dice 1000 times and list the frequency in a chart but when I run the code it gives me a sequence of numbers and letters like so:
Face Frequency
1 [I@6d06d69c
2 [I@6d06d69c
3 [I@6d06d69c
4 [I@6d06d69c
5 [I@6d06d69c
6 [I@6d06d69c
I originally deviated a bit from the tutorial to help me remember it better vs straight up copying but even after that I couldn't get it working. I ended up copying line for line other than the class name and still couldn't get it to output the values even though I saw it working perfectly for someone else.
I'm not sure if I can link the video here but as for on my end was it something in the settings I changed? Or just something simple I've overlooked? I tried researching this but I didn't quite know where to look, I hope someone can help.