Rows extends ArrayList<List<Thing>>
The above definition says that Rows
is a subclass of ArrayList<List<Thing>>
(which means it's a specialized version), not that Rows
is the same thing as an ArrayList<List<Thing>>
.
This means that a Rows
is a kind of ArrayList<List<Thing>>
(so upcasting works) but an ArrayList<List<Thing>>
is not necessarily a Rows
(so downcasting doesn't work).
If you have an object that you've created as a new ArrayList<List<Thing>>
, then this is its type and you can't downcast it further. If you want to be able to use it as a Rows
, you simply need to create it it as a new Rows
.
(By the way, plural is unconventional for class names.)