Android: 2-dimensional List String (List of List)

For a web developer who used mostly PHP and JavaScript for several years, plunging into Java can be challenging especially when it comes to data types.

PHP and JavaScript are loosely typed languages, while Java is strict about types.

I was told that in Android, List<String> is very commonly used, even more than arrays. And now I’ve come to the point when I need to use a 2-dimensional List<String>.

Here’s a sample code:

Output of System.outprintln(Arrays.deepToString(ls.toArray())); is this:

The output of Log.d("serialized", listOfList.toString()); is this:

Related Posts:

Posts that may be related to "Android: 2-dimensional List String (List of List)":


A Filipino programmer and baker. When I have time to spare, I blog, play video games, watch series (usually anime), cook dishes, draw, or spend a little time with pets. When I have the rare luxury of time, I get to travel and record song covers too! Running small-time online dessert shops Cookies PH and Catzie's Cakery.

Leave a Reply

Your email address will not be published. Required fields are marked *