Ricardo Soares wrote: . . . is it correct to declare the ArrayList inside an interface and then implement it on the classes that are gonna access the ArrayList ?
example:
Thanks in advance
No, that is not correct. That looks like the
constant interface anti‑pattern to me. If you want the list publically available, make it such
via a public method
The crafty thing about that code is that you return the List in a read‑only format. You can only add or remove in the original location.