2021-01-22 List, Set and Map all inherit from the Collection interface?

  1. judge right or not. List, Set, and Map all inherit from the inherited Collection interface.

A.
Right B. Wrong

Wrong X
analysis: List and Set are interfaces inherited from Collection interface, Set does not allow duplicate items, List allows duplicate items, and the classes derived from Set interface are TreeSet, HashSet, LinkedHashSet. The classes derived from the List interface include ArrayList, Vector, etc. Map is an independent interface and does not inherit the Collection interface.

Guess you like

Origin blog.csdn.net/weixin_44436675/article/details/112976223