while taking input for an array I am getting the Above Mentioned Exception my code goes like this:
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int height[]=new int [n];
for(int i=0;i<n;i++){
height[i]=sc.nextInt();
}
I have imported java.util package but still scanner is not working