Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package huiswerk.week3;
- public class Circus {
- private String naam;
- private Artiest[] artiesten;
- public Circus(String naam) {
- this.naam = naam;
- artiesten = new Artiest[3];
- artiesten[0] = new Artiest("De Lawineboys");
- artiesten[1] = new Artiest("Stef Ekkel");
- artiesten[2] = new Artiest("Rene Kars");
- }
- public String getNaam() {
- return this.naam;
- }
- public void printArtiesten() {
- System.out.println("Circus " + this.naam + " heeft de volgende " + getAantalArtiesten() + " artiesten:");
- for (int i = 0; i < artiesten.length; i++) {
- System.out.println("* artiest nr. " + (i+1) + " = " + artiesten[i].getNaam() + " (een artiest)");
- }
- }
- public int getAantalArtiesten() {
- return artiesten.length;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement