Hash table in Java, let us discuss some examples on this hash table and habitable objects.
He had hoped to find one hash table, which will hold a string as string is a string object as the key
and integer object as the value.
So we know that has table contents, key value pair.
So the integer class wraps the value of the primitive type IMT in an object.
So there is an integer.
And here we are, having the string class objects to be added.
And this is about hash table.
This class implements a hash table, which maps keys to values.
An internal object can be used as a key or as a value here.
So here we have defined one hash table class object that is the SD hash, and it has got instantiate
it with constructed.
So with this particular hash, we are going to add some key value pairs here.
So desperately method is put.
So here string is the name is the key.
And here are the respective integer.
It would be the respective value here.
So this is a mocs we are actually having.
So Ion 65, D-Block 80.
Joy 55.
75.
And Rahul, that is worth having here.
70 hit.
So now we are printing this SD card hash here.
So let me see that how the outcomes are coming so that that student hash table is having the content
that is to around 75.
You see, we are returning to the Fort Bliss and enjoy five.
We added joy at the third place Deep-Pocketed.
We did this one at the second place, Rahul, 70.
We did that on adding putting this one at the last place and the oil at the hospital is what you see
there.
The order in which they got added to this, the hash that is of a hash table object.
The order has not been maintained, but the key value pair that is Typekit well appears that dark beer
has got maintained throughout.
So in this way, you have got this one.
Now let us suppose I want to add another one say I'm going for the ISTI hash.
That put.
So if I give a same name, say, if I go for the joy.
If I go for the job with the police, they say 767.
So initially, you see the joy as having the of 5:55pm now it has become six or seven, then what will
happen as a quickie is repeating the same key.
So it will it will be not a new entry date.
It will not put a new values back developer there.
So only the joy its value is.
Mox, 55, will be about the six or seven.
So 55 will get upgraded with the value six to seven.
So let us go for that.
You can find that with this joy at having the value 67 here.
OK, so key must be unique and that's why it is known as key and value may repeat and we did with each
and every key.
There should be some one not null value system, not out-of-print calendar student hash table, and
they still has to be got printed.
You see, we got printed this one now we're doing something different here.
So string MAXXI is equal to null, so we are going to hold the name of that student who has secured
the maximum marks.
So I indymac's marks is the digital and MAXXI that is of which will be holding the name is having that
now string initialized at first.
So four string key cologne still has dark key sectors, so incarcerates they have Slashdot Gazette.
All the key values will be will be there.
And for all the keys in the key set that forward, each look will get executed.
It will pick up each and every key one at a time in each and every iteration, and to get the respective
marks against that key.
We should go for Eszterhas start get key and it will be compared with the Max Max.
So if Max Max Max is less than Eszterhas start get key, then Max will be initialized with the new name
that is the key here, and Max Max will be initialized with this new value that is a max here.
So that is the hash dart.
Get key using this jetski, we can get the value of the of the against the key, whatever you are passing
as the input parameter to this get method.
So in this way, you are doing this one.
We know that here the maximum max has been obtained by a deep shock at the maximum Max's 80.
So we are printing the student name and we are printing the student's moxa so we can.
We are expecting that DPR can edit it, expecting that the poor quality should get printed and it has
got printed accordingly in this way.
In this particular demonstration, we have discussed how to deal with the hash table in our Java code.