Why can't you pass List (NOT ArrayList) between actions?

As far as I understand, there is no way to pass a simple object Listbetween actions without Listbeing ArrayList. Perhaps I missed some way to do this? If not, does anyone know why Google will force users to use specific data in their code?

+4
source share
2 answers

You can pass explicit implementations because they implement Serializable, but their abstract and interfaces do not.

The list and other collections are not Serializable, because this is not their definition. They offer a choice for their implementation, since you also have list implementations that are not Serializable.

This is important to have, as you can save data that is not saved for serialization in a list. In these cases, you can choose the implementations that are the best choice for this data, instead of forcing the "List" to be serialized.

+4
source

Since there is an Application class that you can use to store links to such things and much more.

0
source

All Articles