Learn HOW TO SORT A MAP BY VALUE In Java

Pubblicato il: 01 gennaio 1970
sul canale di: Begin Secure
750
13

In this video you will learn how to sort a map by values in Java. Sorting by keys is simple, but how can you do it using values? What if there are duplicates? And what security problems might you introduce into your application if you aren't careful? Tune in and find out. Like and subscribe to get more great content for free.

#IT #Development #SoftwareDevelopment #JavaProgramming #JavaTutorial #AppplicationSecurity #AppSec #appsecurity #informationsecurity #infosec

Chapters

00:00 Introduction
00:23 Overview
00:38 Define the problem
01:32 Code the solution
08:39 Application security discussion

The question today is: how can you sort a Map of key-value pairs using values instead of by keys.

First a little background

The Map interface, from the java.util package is part of the collections API and has been available since Java 1.2

The map interface is used to map keys to values.

A map cannot contain duplicate keys, but there is no such restriction on values

Map contents can be viewed as a set of keys

A collection of values

Or a set of key-value mappings

So how can we sort a map by value instead of key

Great question, let’s take a look

There are a few different ways to accomplish this using both Java 8 and pre-Java 8 techniques

Let’s look at the elegant solution that was introduce in Java 8 using streams


In questa pagina del sito puoi guardare il video online Learn HOW TO SORT A MAP BY VALUE In Java della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Begin Secure 01 gennaio 1970, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 750 volte e gli è piaciuto 13 spettatori. Buona visione!