Check out our courses:
Enterprise Java Spring Microservices: https://go.telusko.com/enterpriseJava
Coupon: TELUSKO10 (10% Discount)
Master Java Spring Development : https://go.telusko.com/masterjava
Coupon: TELUSKO20 (20% Discount)
For More Queries WhatsApp or Call on : +919008963671
Udemy Courses:
Spring: https://go.telusko.com/udemyteluskosp...
Java:- https://go.telusko.com/udemyteluskojava
Java Spring:- https://go.telusko.com/Udemyjavaspring
Java For Programmers:- https://go.telusko.com/javaProgrammers
Python : https://go.telusko.com/udemyteluskopy...
Git : https://go.telusko.com/udemyteluskogit
Docker : https://go.telusko.com/udemyteluskodo...
website : https://courses.telusko.com/
In this lecture we will learn:
Map in collection
Syntax for the Map
How to work with key-value pairs in a map?
Properties of Map in Java
Difference between HashMap and HashTable
#1
Map is not an implementation or it does not extend the collection interface. But it is a part of the collection concept.
Map is a collection of key-value pairs. in this, for every value of an element, a key is associated with it.
Map itself is in an interface that supports key-value pairs. A class that implements it is called HashMap.
#2
We can add elements in a map using the put() method that accepts both the key and value of it.
We can get the value of an element by specifying its key of it in the get() method.
Keys are unique but values can be repeated. The value of a key can also be updated.
In a map, keys are in a set while values are in a list.
We can get all the keys by using the method keySet().
We can get the value of a key by using the method get() and pass a parameter as a key in the method.
remove() method is used to delete a particular element or an entity from a map.
#3
We can also use a HashTable instead of using a HashMap.
The difference between HashMap and HashTable is that HashTable is synchronized while HashMap is normal.
If you are working with multiple threads at a time, then it is better to use a HashTable to make it synchronized.
Github repo : https://github.com/navinreddy20/Javac...
Instagram : / navinreddyofficial
Linkedin : / navinreddy20
Discord : / discord
Java:- https://bit.ly/JavaUdemyTelusko
Spring:- https://bit.ly/SpringUdemyTelusko
More Learning :
Java :- https://bit.ly/3x6rr0N
Python :- https://bit.ly/3GRc7JX
Django :- https://bit.ly/3MmoJK6
JavaScript :- https://bit.ly/3tiAlHo
Node JS :- https://bit.ly/3GT4liq
Rest Api :-https://bit.ly/3MjhZwt
Servlet :- https://bit.ly/3Q7eA7k
Spring Framework :- https://bit.ly/3xi7buh
Design Patterns in Java :- https://bit.ly/3MocXiq
Docker :- https://bit.ly/3xjWzLA
Blockchain Tutorial :- https://bit.ly/3NSbOkc
Corda Tutorial:- https://bit.ly/3thbUKa
Hyperledger Fabric :- https://bit.ly/38RZCRB
NoSQL Tutorial :- https://bit.ly/3aJpRuc
Mysql Tutorial :- https://bit.ly/3thpr4L
Data Structures using Java :- https://bit.ly/3MuJa7S
Git Tutorial :- https://bit.ly/3NXyCPu
Donation:
PayPal Id : navinreddy20
https://www.telusko.com