RUVIDEO
Поделитесь видео 🙏

Java: Collections and Maps

📁 Обучение 👁️ 16 📅 05.12.2023

Data-Structures are to a Developer as what a Chisel-and-Hammer is to a Sculptor.

# Collections in Java

## Descriptions:

Collections framework is a large set of data structures used for managing data in Java
Collection is a group of individual objects represented as a single unit. Java provides
Collection Framework which defines several classes and interfaces to represent a group
of objects as a single unit.

## Types:

- Map
- Set
- List

## Map:

### Introduction

Map is generic interface for a key-value pair data structure
Takes place of the Dictionary class, which was a purely abstract class and not an Interface.

### Types:

Known Sub-Interfaces:
- Bindings, ConcurrentMap, ConcurrentNavigableMap, LogicalMessageContext,
MessageContext, NavigableMap, SOAPMessageContext, SortedMap

All Known Implementing Classes:
- AbstractMap, Attributes, AuthProvider, ConcurrentHashMap, ConcurrentSkipListMap, EnumMap,
HashMap, Hashtable, IdentityHashMap, LinkedHashMap,
PrinterStateReasons, Properties, Provider, RenderingHints, SimpleBindings, TabularDataSupport,
TreeMap, UIDefaults, WeakHashMap

#### Notable Implementations:

- HashMap : Hash-table based implementation of Map.
HashMap extends AbstractMap and implements Map alongwith Serializable and Clonable
HashMap is un-synchronized. Not thread safe.
HashMap allows one NULL key and multiple NULL values.
HashMap performance depends on initial-capacity and load-factor.
Initial-Capacity: No of buckets allowed
Load-Factor: How full the Map is allowed to be build before its capacity is
automatically increased. When total number of entries
reach (current capacity*load-factor) then the HashMap is rehashed such
that number of buckets is twice.
Default load-factor : 0.75
- TreeMap : A Red-Black Tree based Navigable Map implementation.
Map is sorted as per natural ordering of its keys, or based on Comparator
provided at Map creation time.
Performance guaranteed is log(n) for containsKey, get, put and remove methods.
Extends AbstractMap and implements NavigableMap, alongwith Serializable and Clonable
TreeMap is un-synchronized. Not thread-safe.

- Hashtable : Maps a key to a value.
Stores non-null value as key or value.
Extends Dictionary class.
Does not allow any NULL key or NULL values
Hashtable performance depends on initial-capacity and load factor.
Capacity: Total number of buckets allowed
Load-Factor: How full the Hashtable is allowd to be build before its capacity is automatically increased. When total number of entries
reach (current capacity*load-factor) then the Hashtable is rehasehd such that number of buckets is increased.
Default load-factor: 0.75

Hashtable is Thread safe (synchronized).
If Map is not used across threads, its recommended to use HashMap instead of Hashtable.

- ConcurrentHashMap : A hashtable which provides concurrency of retrievals and
high concurrency for updates, without blocking entire table.
Retrieval operations do not block. So, may overlap with update operations
(including put and remove).
So, retrievals reflect the current state of Map at the time of operation
being performed.
Iterators are designed such that they work for one thread at a time.
Table is dynamically expanded when there are too many collisions.

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Java: Collections and Maps», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.