Mismatch on data type? I converted all my ints to long?

Viewed 56
import java.util.Random;
import java.util.Scanner;
public class ArrayPractice {
public static void main(String[] arg) {
    long input;
    System.out.println("How Many Times will you roll?");
    Random random=new Random();     
    Scanner scan=new Scanner(System.in);
    input=scan.nextLong();
    long freq[]=new long[7];
    for(long i=1;i<input;i++){
        //1+random.nextInt(6)-numbers 1-6
        ++freq[1+random.nextLong(6)];
    }
    System.out.println("Face\tFrequency");
    for(long i=1;i<freq.length;i++){
        System.out.println(i+"\t"+freq[i]);
    }
}
}

Why is my program saying that their is a mismatch at ++freq[1+random.nextLong(6)]; and freq[i]I converted all my values to long. Why should their be a mismatch?

2 Answers
Related