LoganBlackisle

sysout test

Jul 26th, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. public Student findStudent(int studieNr) {
  2.         Student student = null;
  3.         boolean found = false;
  4.         for (Integer i : students.keySet()) {
  5.             System.out.println(found + " 1");
  6.             if (i == studieNr) {
  7.                 System.out.println(found + " 2");
  8.                 found = true;
  9.                 student = students.get(i);
  10.             }
  11.         }
  12.         if (found = true) {
  13.             System.out.println(found + " 3");
  14.             return student;
  15.         } else {
  16.             System.out.println(found + " 4");
  17.             return null;
  18.         }
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment