Advertisement
Guest User

Untitled

a guest
May 30th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. public boolean contains(Student s){
  2. //TODO: Your Code here.
  3. for (int i=0; i<=array.length-1;i++)
  4. {
  5. if (array[i]!=null)
  6. {
  7. Student student = array[i];
  8.  
  9.  
  10. if (s.equals(student))
  11. {
  12. System.out.println("Student " +s +" ist schon im Array");
  13. return true;
  14. }
  15. }
  16. else
  17. {
  18. return false; //false wenn eine Lücke gefunden wird
  19. {
  20.  
  21. }
  22. return false;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement