Summary
In this chapter, we looked at how to use simple Kotlin arrays to store substantial amounts of data provided that it is of the same type. We also used ArrayList
, which is like an array with lots of extra features. Furthermore, we discovered that both arrays and ArrayList
are polymorphic, which means that a single array (or ArrayList
) can hold multiple different objects as long as they are all derived from the same parent class.
We also learned about the HashMap
class, which is also a data storage solution, but which allows access in different ways.
In the next chapter, we will learn about Adapter
and RecyclerView
to put the theory into practice and enhance our Note to self app.