These are common patterns that Java also supports. Think that without Generics you can declare a thing like this.
It could be like this:
HashMap table = new HashMap(); ArrayList arr = new ArrayList(); arr.Add(table);
Using Generics, instead of working with objects and casting or transforming (late restriction), you can write as simple as possible. As you mentioned:
private ArrayList<HashMap<String, String>> data;
and so itβs easier to work with the declared variable.
Greetings
source share