I have written a Java program where I want the user to insert elements and then have these elements in an array and print it. whenever I want my program to print the array a random combination of letters and numbers show up instead of the array, can anyone please tell me what modifies I can do in order to get the array .
here's my code: import java.util.Scanner;
public class arrays {
public static void main(String[] args) {
Scanner zz = new Scanner(System.in);
int[] arraya = new int[5];
System.out.println("enter array elements");
for(int i = 0 ; i< arraya.length ; i++) {
arraya[i]= zz.nextInt();
}
System.out.println(arraya);
}