title: why can't i change base address of array in java while passing it as parameter?
body: <p>I have written some code to find the first index of an element in an array in java but it's not working because arr+1 is not working. Can someone explain why I can't change the base address of the array in java?</p>
  <pre><code>public static int firstIndex(int[] arr, int n , int key ){
          if(n==0){
              return -1;
          }
          if(arr[0] == key)
          {
              return 0;
          }
          else{
              int fi  = firstIndex(**arr+1**,n-1,key);
              if(fi==-1){
                  return -1;
              }
              else return fi+1;
          }
  </code></pre>