```
public class TestArray04{
public static void main(String[] args){
int[] arr={12,34,56,7,3,10};
insertEle(arr,1,100);
System.out.print("修改后的值"); //修改后的值
for(int i=0;i<arr.length;i++){
if(i!=arr.length-1){
System.out.print(arr[i]+",");
}else{
System.out.print(arr[i]);
}
}
}
//修改前的值
public static void insertEle(int[] arr, int index, int ele){
for(int i=arr.length-1;i>=(index+1);i--){
arr[i]=arr[i-1];
}
arr[index]=ele;
}
}
```