저는 프로세스라는 객체의 arraylist를 가지며 각 프로세스에는 할당, 최대 및 필요에 대한 정수의 arrayList가 있습니다. 따라서 각 프로세스에는 본질적으로 3 명의 arraylists가 있습니다. 나는의 배열의 모든 크기 4. 그래서이어떻게 서로 나란히 여러 개의 ArrayList를 인쇄 할 수 있습니까
Allocation Max Need
Process 1 1 2 3 4 1 2 3 4 1 2 3 4
Process 2 5 7 8 9 5 7 8 9 5 7 8 9
Process 3 1 2 3 4 1 2 3 4 1 2 3 4
Process 4 5 7 8 9 5 7 8 9 5 7 8 9
등 각 숫자가 자신의 슬롯처럼 보이는 테이블을 만들려고 노력하고 있어요 이것은 내가
public String toString() {
String temp = "";
String tempAllo = "";
String tempMax = "";
String tempNeed = "";
for (int j = 0; j < allocation.size(); j++) {
tempAllo = allocation.get(j).toString() + " ";
tempMax = max.get(j).toString() + " ";
tempNeed = need.get(j).toString() + " ";
}
temp = id + "\t" + tempAllo + "\t" + tempMax + "\t" + tempNeed + "\n";
return temp;
}
을 시도하고 내 코드입니다
하지만 그래서 마지막 하나를 인쇄하는
Allocation Max Need
Process 1 4 4 4
Process 2 9 9 9
Process 3 4 4 4
Process 4 9 9 9
출력합니다. 그것은해야 도움