I noticed that if I do something like:
ArrayList anArray = new ArrayList();
anArray.add(anArray);
Netbeans auto-compiler doesn't seem to have any problem with it and I still seem to be able to reference everything. Are there any bad side effects of doing this?
I doubt anything bad would happen in most cases.
The problem would come if you were processing the list recursively in which case you'd end up with a stack overflow.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With