Sorted Maps and the Map Interface: Java Collections Framework Tutorial Part 4

preview_player
Показать описание
-------------------------------------------------------------------------------------------------------------------------------------------
A tutorial on two types of map data structure in Java that maintain some kind of order in your map entries. In this tutorial I also explain a bit more about the point of interfaces, plus another way of iterating through maps.
--------------------------------------------------------------------------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

These videos are really fancy. Usually drink beer or vodka when I'm coding. After this I'm gonna go grab a glass of wine.

xteric
Автор

So far the best Java tutorials I have seen on YouTube (at least far as I am concerned).

talhaakram
Автор

6 years later and your tutorials help a lot!

sakuray
Автор

John, I have finished the beginner and Multithread and got your course on JSP on udemity, definitely the best.

californiaesnuestra
Автор

Hi John,

This is one of the better tutorials that are available over the web. Thanks for all your tutorials as its really helped me understand these concepts well.

prakashkrishnan
Автор

John I really love you videos! If I could afford it I'd pay for a tutorial every day!

thAttempt
Автор

Most excellent tutorials John. Didactlically well done! Thank you so much. I shall make sure that more people are aware.

mateuszalmannai
Автор

I'm watching lesson 4, and by the way, your new mic is great :D, it deserves this serials of tutorials.

claes
Автор

Hi John... It's Superb video.. your explanation is too good and very easy to understand...Hats off to you ;)

rajum
Автор

Awesome videos Jhon. You explained very well. I hope you still working on sets.

malleshamm
Автор

Thinking about using the interface type, say Map<> everywhere but the new, or specifying the exact one everywhere -- I normally choose to use the generic type everywhere but the new because that makes it relatively easy to change back and forth between the implementations for tuning. But, if you do this, you need to be very careful that you clearly document any code that makes any specific assumptions about which underlying implementation you use, if you had to go in and change them all by hand at least you would see it. For example, if you had some method that assumed natural order of keys or that they would be presented in the order that they were originally added, you wish that code would break compilation and not just return wacky results if you change the underlying representation. That doesn't mean you shouldn't ever do it, but you do want to document the assumptions carefully, especially in situations where your tests might possibly behave the same but when you release it into the real world the code starts behaving differently. Lastly, if you don't think this is a good playlist to go into how HashMap works internally, you can still say that its goal in life is to just look up random queries as fast as possible, and whatever ordering seems to support that mission is what gets used. That is why you shouldn't ever depend on that order, it isn't changing the order to be snarky, the whole concept of that type is that order doesn't matter and just please be as fast as possible, so when the order changes upon changing its contents, it is actually just doing you a favor.

jvsnyc
Автор

I dont know if this has changed since you made this video, but it's important to note the Map interface does not implement the Collections interface. The three interfaces directly under "Collections" are "List", "Set", and "Queue".

kenmken
Автор

Thank you Very MUCH John, I enjoy ur courses, , I've been watching most of ur series and I'm still learning A lot  ^^ Thank you Very MUCH Again

ayman-ko
Автор

Thank you very much !! for all your tutorials as its really helped me understand.

silmankhan
Автор

Thank you so much for these informative videos.. Very helpful!

PratikJain
Автор

Great video! I was using streams and trying to sort a map at work and kept trying to do HashMap::new and competly forgot that it's unordered and defeats the purpose of ordering!!!

ripperx
Автор

thank you john!!! your tutorials are neat and concepts are very nicely explained...

praveenist
Автор

Can you do a tutorial on Method Expressions and how they relate to lambda expressions? Thanks for all of your tutorials; definitely the best in the world!

archlefirth
Автор

Isn't this just the "put" method? Sounds like a homework question to me :)

caveofprogramming
Автор

That was explained very well, Thank you s much :) :)

hiyamghannam