Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Student findStudent(int studieNr) {
- Student student = null;
- boolean found = false;
- for (Integer i : students.keySet()) {
- System.out.println(found + " 1");
- if (i == studieNr) {
- System.out.println(found + " 2");
- found = true;
- student = students.get(i);
- }
- }
- if (found = true) {
- System.out.println(found + " 3");
- return student;
- } else {
- System.out.println(found + " 4");
- return null;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment