Advertisement
Cs_java987

Untitled

Feb 19th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. public void removeAnimal(int code) {
  2. for (int i = 0; i < numofanimals; i++) {
  3. if (animal[i].getCode() == code) {
  4. animal[i] = null;
  5. for (int j = i; j < numofanimals - 1; j++) {
  6. animal[j] = animal[j + 1];
  7. }
  8. animal[numofanimals] = null;
  9. numofanimals--;
  10. }
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement