Advertisement
Kwintendr

Untitled

Dec 13th, 2012
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.51 KB | None | 0 0
  1. package Lawaaimaken;
  2. import java.util.*;
  3. public class AnimalFarm {
  4.  
  5.     /**
  6.      * @param args
  7.      */
  8.     public static void main(String[] args) {
  9.        
  10.         ArrayList<LawaaiMaker> dieren = new ArrayList<LawaaiMaker>();
  11.        
  12.         for (int i = 0; i<dieren.size(); i++){
  13.            
  14.             int z = (int)(3*Math.random());
  15.            
  16.             if (z==0) dieren.add(new Kat());
  17.             else if (z==1) dieren.add(new Hond());
  18.             else dieren.add(new Koe());
  19.            
  20.         }
  21.        
  22.         for (int i = 0; i<dieren.size(); i++){
  23.             (dieren.get(i)).maakLawaai();
  24.         }
  25.        
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement