get1
을 mealplan[complete][0][1]
에 할당해야하지만 디스플레이 할 때 [null, null, null, null, null]
만 표시하면됩니다. 문자열 과일 [] []와 Mdtfruit은 [] [] {"Apple","35","1","pc","40"}
문자열 배열 내용을 java의 문자열 배열 색인에 복사하는 방법은 무엇입니까?
String[][][][] mealplan = new String[7][6][4][5];
int complete=0;
boolean finished=false;
while(!finished)
{
String[] get1=new String[4];
int num=rand.nextInt(29);
get1=fruits[num];
int t = Integer.parseInt(get1[1]);
get1[1]=String.valueOf(t*Integer.parseInt(Mdtfruit[2]));
int t2 = Integer.parseInt(get1[2]);
get1[2]=String.valueOf(t2*Integer.parseInt(Mdtfruit[2]));
int t3 = Integer.parseInt(get1[4]);
get1[4]=String.valueOf(t3*Integer.parseInt(Mdtfruit[2]));
mealplan[complete][0][1]=get1;
complete+=1;
if(complete==6)
finished=true;
}
4D 배열은 아직 배열 인덱스가 0에서 시작한다는 것을 알지 못하는 사람에게 너무 복잡합니다. 배열 인덱스는 알고 있습니다 ... – John3136