Find and return the sum of all elements of array which are either divisible by 2 or 3 : <p>I am new to programming and whenever I run this code I am getting a runtime error[NZEC].I dont know how to fix the error </p>

<pre><code>import java.util.Scanner;

public class divi2or3 {
    public static int findSum(int arr[])
    {
      Scanner s = new Scanner(System.in);
      int n = s.nextInt();
      for(int i=0;i&lt;n;i++){
        arr[i] = s.nextInt();
      }
      int sum=0;
      for(int j=0;j&lt;n;j++)
      {
        if(arr[j]%2==0 || arr[j]%3==0){
        sum = sum + arr[j];
        }
      }
      s.close();
      return sum;  

    }

}
</code></pre>
