Why Map does not extend Collection interface?

Collections in any language is an interface that stores similar data type objects and provides an iteration functionality. The common extensions of Collection are List and Set.

The Map is a well-known data structure used to store key-value pairs where keys will be unique.

This post was originally posted at https://agrawalsuneet.github.io/blogs/why-map-does-not-extend-collection-interface/ and reposted on Medium on 28th April 2021.

We can take a reference of any language but let’s look at the example of Java for reference as Collection Framework from Java is very popular.

Java has Iterable interface which is extended by Collection. The Collection is further extended by List, Queue and Set which has their different-different implementations but the unique thing notice is that the Map interface doesn’t extend Collection interface.

Why Map does not extend Collection interface?

Please continue reading at https://agrawalsuneet.github.io/blogs/why-map-does-not-extend-collection-interface/

That’s all for now. You can read my other interesting posts here or you can enjoy my games or apps listed here. Feel free to use my open-source Android components in your app listed here. Or drop an email, if you didn’t find what you are looking for and need some help.





Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Integration of Huawei Account Kit in Attendance Tracker Android app (Kotlin) — Part 1

Distribute React Native App to Google Play using Codemagic (CI/CD Process)

how to get image from gallery in android 10 and above

Delving into Mobile Hardware

Shimmer effect in android

Coroutines for Android

Integrating Firebase to your flutter application

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Suneet Agrawal

Suneet Agrawal


More from Medium

Android Kotlin — Save Files To Emulator

Jetpack Compose Basics for Beginners

Generic SharedPreferences in Android

Room Database in Kotlin