1个回答
展开全部
public class Test {
public static void main(String[] args) {
int length = 5;
int ai = 1;
String data = "data";
String[] array = insertArrar(data, ai, length);
data = delArray(array, ai, length);
System.out.println(data);
}
public static String[] insertArrar(String data,int ai,int length){
String[] array = new String[length];
array[ai] = data;
return array;
}
public static String delArray(String[] array,int ai,int length){
String data = "";
data=array[ai];
array[ai]=null;
for(int i = 0; i<array.length;i++){
System.out.println(array[i]);
}
return data;
}
}
public static void main(String[] args) {
int length = 5;
int ai = 1;
String data = "data";
String[] array = insertArrar(data, ai, length);
data = delArray(array, ai, length);
System.out.println(data);
}
public static String[] insertArrar(String data,int ai,int length){
String[] array = new String[length];
array[ai] = data;
return array;
}
public static String delArray(String[] array,int ai,int length){
String data = "";
data=array[ai];
array[ai]=null;
for(int i = 0; i<array.length;i++){
System.out.println(array[i]);
}
return data;
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询