public static void main(String[] args) {
int[] xr = {1, 2, 3, 4, 5};
int key = 3;
for (int i = 0; i < xr.length ; i++) {
if (key==xr[i]){
System.out.println("element is: "+i);
}
}
}