when i code this no error appears to me but when compile it >> give me error >> what is the wrong with that ??
public static void main (String args []){
int arr[] = {20 , 30 ,40 , 50 , 60 ,200 };
int searchKey = 20 ;
for (int i = 0 ; i < arr.length ; i++ ){
if (arr[i]== searchKey){
System.out.println(searchKey + "found");
for(int z = i ; z < arr.length ;z++){
arr[z] = arr[z+1];
}
for(int k=0 ; k<arr.length ; k++)
System.out.print(arr[k] + " ");
break;
}
else if (i == (arr.length-1) ) {
System.out.print(searchKey+ " not found");
break;
}
}
}