0
    Scanner scan=new Scanner(System.in);
    int n=scan.nextInt();
    int arr1[]=new int[n];
    String arr2[]=new String[n];
    float arr3[]=new float[n];
    for(int i=0; i<n; i++){
        arr1[i]=scan.nextInt();
        arr2[i]=scan.nextLine();
        arr3[i]=scan.nextFloat();
    }

I had just started to use java. I am getting input mismatch exception. please help me to find the error.

  • Does this answer your question? [How can I read input from the console using the Scanner class in Java?](https://stackoverflow.com/questions/11871520/how-can-i-read-input-from-the-console-using-the-scanner-class-in-java) – pringi Feb 07 '22 at 10:56

0 Answers0