Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.63 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import java.util.Iterator;
  3. /**
  4.  * Write a description of class Uia here.
  5.  *
  6.  * @author Christian Moen
  7.  * @version 1.0
  8.  */
  9. public class Uia
  10. {
  11.     private ArrayList<Student> studenter;
  12.     public Uia() {
  13.         this.studenter = new ArrayList<>();
  14.     }
  15.    
  16.     public void fjernStudent() {
  17.         Iterator<Student> liste;
  18.         liste = studenter.iterator();
  19.        
  20.         while (liste.hasNext()) {
  21.             Student student = liste.next();
  22.             if (student.getFornavn().equals(student)) {
  23.                 liste.remove();
  24.             }
  25.        
  26.         }
  27.        
  28.     }
  29.    
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement