omgeving has a size of 3, Wereld has a size of 10
why cant i copy the 9 cels of Wereld to omgeving? 3 by 3 is 9 cels, right?
Type: Posts; User: waarten
omgeving has a size of 3, Wereld has a size of 10
why cant i copy the 9 cels of Wereld to omgeving? 3 by 3 is 9 cels, right?
omgeving[i][j] where i and j are 0, 1 or 2 (so size 3?)
it's empty till the cel's of Wereld[][] are linked to it.
Wereld[][] is has the size of nrrijen (number of rows) and nrkolommen (number of...
Get another error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Ecosysteem.run(Ecosysteem.java:169)
at Ecosysteem.main(Ecosysteem.java:273)
about...
Fixed it with adding Wereld[rij][kolom] != null to the if statement.
It could. I created a field (nrrijen by nrkolommen) were a number of rabbits (konijn) and foxes (vos) are randomly placed, so some cels stay empty.
This was exactly what was going on, thanks for helping.
I've done a lot of work on it and now I'm getting my next error:
Exception in thread "main" java.lang.NullPointerException
at...
File structue:
Idier.java - This is the interface for the animals
Dier.java - implements the IDier interface (dier = animal)
Konijn.java - extends Dier.java (konijn = rabbit)
Vos.java - extends...
As far as I know, none of the class's are in a package.
The assignment gives the IDier.java and IEcosystem.java files (can't make any changes to them) and the other files must be created by the...
isKonijn and isVos are defined in Konijn.java and Vos.java:
The beginning of Konijn.java:
class Konijn extends Dier {
boolean isKonijn;
/**
* Deze...
hi,
I i'm writing some code code for a school assignment, but I get stuck at a cannot find symbol error:
javac *.java
Ecosysteem.java:34: cannot find symbol
symbol : variable isKonijn...