import java.util.*;
public class RemoveElement{
public static void main(String args[]){
int[] myarr = {12,14,16,13,89,10,34};
System.out.println("The entered array is :"+ Arrays.toString(myarr));
Scanner sc = new Scanner(System.in);
System.out.println("Enter the Index to be removed");
int n=sc.nextInt();
//Remove index 1 and element 14;
for(int i=n; i<myarr.length-1;i++){
myarr[i]=myarr[i+1];
}
//We can not alter the size of array so the last and second last element will be same .
System.out.println("After removal, the final array is :"+ Arrays.toString(myarr));
}
}