Advertisement
Guest User

Untitled

a guest
Feb 24th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1.     public String UpdateArticle(Article article, String id) {
  2.  
  3.         for( int i = 0; i < articles.size(); i++ ) {
  4.            
  5.             Article a = articles.get(i);
  6.            
  7.             if( a.getId().equals(id)) {
  8.                
  9.                 articles.set(i, article);
  10.                 return "Pomyślnie zaktualizowano wpis";
  11.                
  12.             }else {
  13.                
  14.                 return "Nie udało się zaktualizować wpisu";
  15.                
  16.             }
  17.            
  18.         }
  19.        
  20.         return "Wystąpił nieoczekiwany błąd";
  21.        
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement