Java multidimentional arrays

preview_player
Показать описание
Code:

Рекомендации по теме
Комментарии
Автор

Just check while inserting into the array, in the loop if the value is already present there.
for (newElement iteration here) {
// You are iterating values that you want to add to the table.

boolean elementPresent = false;

for (int i; i<currentTableLength; i++) {
if (table[i]==newElement) {
elementPresent = true;
}
}

if( ! elementPresent) {
// Insert it into the table
table[currentTableLength++] = newElement;
}
}

itcuties
welcome to shbcf.ru