This site requires JavaScript, please enable it in your browser!
Greenfoot back
Favna
Favna wrote ...

2014/11/26

Question about arrays

1
2
davmac davmac

2014/12/8

#
Just to expound a bit more, changing the statement to avoid the 'new boolean' doesn't work for me; this workaround might be Java version dependent. A workaround that should work for all Java versions is to declare the field either public or private, eg:
1
private boolean[] items = new boolean[] {false, false, false};
You need to login to post a reply.
1
2