Advertisement
Guest User

occFunction

a guest
Feb 23rd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.30 KB | None | 0 0
  1.     public void removeAllOccurences (Book book) {
  2.        
  3.         for(int i=0; i<this.numberOfBooks(); i++) {
  4.            
  5.             if(arrayBook[i].equals(book)) {
  6.                
  7.                 for(int j=i+1; j<this.nbLivre; j++) {
  8.                     arrayBook[j-1]=arrayBook[j];
  9.                 }//FIN FOR
  10.                
  11.                 i--;
  12.                 this.nbLivre--;
  13.             }//FIN IF
  14.         }//FIN FOR
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement