Now a days in interview interviewer always ask questions related to Collection and map
And they also ask why map interface is not child of collection interface.
Here is very simple resion
Collection talks about individual object. in collection we can store only individual objects.
Where Map talks about storing the object as key and value pairs. here key and value are two objects.
That's why Map doesn't extends the Collection interface.
And they also ask why map interface is not child of collection interface.
Here is very simple resion
Collection talks about individual object. in collection we can store only individual objects.
Where Map talks about storing the object as key and value pairs. here key and value are two objects.
That's why Map doesn't extends the Collection interface.
No comments:
Post a Comment