public static boolean searchInArray(int[] data,int key){
  for (int i=0; i < data.length; i++) {
    if (key == data[i]) {
      return true;
    }
  }
  return false;
}

public static boolean searchInArray ( int [ ] data , int key ) { for ( int i = 0 ; i < data . length ; i ++ ) { if ( key == data [ i ] ) { return true ; } } return false ; }
return true if given key is found in array
