We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I need an array from type boolean with no specified size at the beginning. In this case I usually use ArrayList, but it doesn't work for boolean type...
This works:
ArrayList<String> thisArray = new ArrayList<String>();
And this doesn't:
ArrayList<boolean> thisArray = new ArrayList<boolean>();
Can someone help? Thanks!
Answers
boolean
is Boolean:http://docs.Oracle.com/javase/8/docs/api/java/lang/Boolean.html
There's also an alternative container class which saves much more RAM (at the expense of CPU) called BitSet: *-:) http://docs.Oracle.com/javase/8/docs/api/java/util/BitSet.html