Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. public ArrayList<Object> vijandenMaken(String aantal) {
  2. this.aantalVijandenLijst = new ArrayList<>();
  3. try {
  4. int invoer = Integer.parseInt(aantal);
  5. if (invoer < 1 || invoer > 10) {
  6. System.out.println("invoer moet tussen 1 en 10 liggen");
  7. } else {
  8. this.aantalVijanden = invoer;
  9. for (int i = 1; i <= this.aantalVijanden; i++) {
  10. this.aantalVijandenLijst.add(new Mus(4));
  11. }
  12. }
  13. } catch (NumberFormatException e) {
  14. System.out.println("foute invoer");
  15. }
  16. return aantalVijandenLijst;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement