#94 Map in Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025
  • Check out our courses:
    Java Full Stack and Spring AI - go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    DevOps with AWS: From Basics to Mastery : go.telusko.com...
    Coupon: TELUSKO10 (10% Discount)
    Master Java Spring Development : go.telusko.com...
    Coupon: TELUSKO20 (20% Discount)
    For More Queries WhatsApp or Call on : +919008963671
    Udemy Courses:
    Spring: go.telusko.com...
    Java:- go.telusko.com...
    Java Spring:- go.telusko.com...
    Java For Programmers:- go.telusko.com...
    Python : go.telusko.com...
    Git : go.telusko.com...
    Docker : go.telusko.com...
    website : courses.telusk...
    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 : github.com/nav...
    Instagram : / navinreddyofficial
    Linkedin : / navinreddy20
    Discord : / discord
    Java:- bit.ly/JavaUde...
    Spring:- bit.ly/SpringU...
    More Learning :
    Java :- bit.ly/3x6rr0N
    Python :- bit.ly/3GRc7JX
    Django :- bit.ly/3MmoJK6
    JavaScript :- bit.ly/3tiAlHo
    Node JS :- bit.ly/3GT4liq
    Rest Api :-bit.ly/3MjhZwt
    Servlet :- bit.ly/3Q7eA7k
    Spring Framework :- bit.ly/3xi7buh
    Design Patterns in Java :- bit.ly/3MocXiq
    Docker :- bit.ly/3xjWzLA
    Blockchain Tutorial :- bit.ly/3NSbOkc
    Corda Tutorial:- bit.ly/3thbUKa
    Hyperledger Fabric :- bit.ly/38RZCRB
    NoSQL Tutorial :- bit.ly/3aJpRuc
    Mysql Tutorial :- bit.ly/3thpr4L
    Data Structures using Java :- bit.ly/3MuJa7S
    Git Tutorial :- bit.ly/3NXyCPu
    Donation:
    PayPal Id : navinreddy20
    www.telusko.com

ความคิดเห็น • 22

  • @samiahmad5612
    @samiahmad5612 ปีที่แล้ว +7

    00:03 Map provides a way to associate values with unique keys.
    01:22 Using a map to store key-value pairs
    02:40 Data types and class for implementing a hashmap
    03:53 Map data structure in Java
    05:01 Keys are unique, values can be the same
    06:19 Print all values using a for loop
    07:38 You can print all the values from a map using the get method.
    08:55 Hash table and hash map are similar but hash table is synchronized while hash map is not.

  • @RaghavSaggu
    @RaghavSaggu 4 หลายเดือนก่อน +7

    I suggest to all viewers to check internal implementation of maps, these data structures are way different than they looks and not discussed even 1% in this video. Though this video gives nice information to start working with Maps.

    • @anant8321
      @anant8321 2 หลายเดือนก่อน

      Can you suggest any videos for the implementation purpose ?

  • @nuclear_works
    @nuclear_works ปีที่แล้ว +1

    You are doing a great job by saving millions of Student"s Neck.
    Thank you very much

  • @Mshagy02
    @Mshagy02 ปีที่แล้ว +2

    Thank you for this. this is the clearest video I've found on the topic

  • @vinayraut4843
    @vinayraut4843 ปีที่แล้ว +1

    Thank you sir for making such great videos,ur explanations are perfect, I performed good in my practical exams because of uh only ❤️💯

  • @kausigayokeshk3160
    @kausigayokeshk3160 5 หลายเดือนก่อน

    00:03 Map provides a way to associate values with unique keys.
    01:22 Using a map to store key-value pairs
    02:40 Data types and class for implementing a hashmap
    03:53 Map data structure in Java
    05:01 Keys are unique, values can be the same
    06:19 Print all values using a for loop
    07:38 You can print all the values from a map using the get method.
    08:55 Hash table and hash map are similar but hash table is synchronized while hash map is not.
    Crafted by Merlin AI.

  • @Edd_Elric
    @Edd_Elric 2 ปีที่แล้ว +2

    Thanks for all your content, very nice!

  • @AkashAkash-z5x5d
    @AkashAkash-z5x5d 27 วันที่ผ่านมา

    5:17 😂😂 Funny Sir

  • @neoness1268
    @neoness1268 2 ปีที่แล้ว +2

    Good explanation 👌

  • @Kramn-e8f
    @Kramn-e8f ปีที่แล้ว

    THANK YOU i was not understanding this very well

  • @jmitmandalia
    @jmitmandalia ปีที่แล้ว

    Thank you Navin. This course is great.
    Can you please also tell me what is the tool you are using to draw the diagram, in colors, in these videos? That is best tonuse for all remote worker like, when work with clients.

  • @THEREELCOMMUNITY
    @THEREELCOMMUNITY ปีที่แล้ว

    Thanks bud ❤

  • @kirusanth
    @kirusanth ปีที่แล้ว +1

    Just like Associative array in php right sir?

  • @ajayghode3602
    @ajayghode3602 หลายเดือนก่อน

    Thank you.

  • @dustinhicks3329
    @dustinhicks3329 ปีที่แล้ว

    At 2:17 you clicked on the Map reference and it pulled up what looks like the java docs for the Map class. Is that an extension that you have installed?

    • @nenuanenenuane6645
      @nenuanenenuane6645 ปีที่แล้ว

      no u can just click on map
      java classes will open automatically if they are present

  • @jaypople8885
    @jaypople8885 ปีที่แล้ว

    Sir, What if you have 2 or more student of same name in this example? how can we add new one instead of updating previous one.

    • @Mshagy02
      @Mshagy02 ปีที่แล้ว +1

      Use a more discriptive key. for example use first and last name of the student

  • @KrishnenduBiswas-k8s
    @KrishnenduBiswas-k8s 2 หลายเดือนก่อน

    dictionary?

  • @VeluR-1993
    @VeluR-1993 6 หลายเดือนก่อน

    What if one key has multiple value. How to get the values. Please help.

    • @CEEPATHIAARYA
      @CEEPATHIAARYA 5 หลายเดือนก่อน +1

      Map mp = new HashMap();