public class ArrayDemo {
 
  /**
   * Return the index of the value e
   * in the array a, or -1 if that value
   * is not in the array.
   */ 
  public static int findElement(int[] a, int e) {
    for(int i = 0; i < a.length; i++) {
      if(a[i] == e) {
        return i;
      }
    }
    return -1;
  }
  
  /**
   * Example of returning an array.
   */ 
  public static int[] returnArray(int[] a) {
    return a;
  }
  
  /**
   * Display the contents of an array a from 
   * index i to index j.
   */ 
  public static void display(int[] a, int i, int j) {
    for(int k = i; k < j; k++) {    
      System.out.println(a[k]);
    }
  }
}
