<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>write your own hashmap/hashtable implementation in java - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/write-your-own-hashmap-hashtable-implementation-in-java/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/write-your-own-hashmap-hashtable-implementation-in-java/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Mon, 02 May 2022 06:18:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>write your own hashmap/hashtable implementation in java - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/write-your-own-hashmap-hashtable-implementation-in-java/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How HashMap Works in Java ?</title>
		<link>https://www.wikitechy.com/interview-questions/java/how-hashmap-works-in-java/</link>
					<comments>https://www.wikitechy.com/interview-questions/java/how-hashmap-works-in-java/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Tue, 13 Jul 2021 23:07:25 +0000</pubDate>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[Applied Materials interview questions and answers]]></category>
		<category><![CDATA[Atos interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Ciena Corporation interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[custom hashmap implementation in java]]></category>
		<category><![CDATA[dark horse digital interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[FIS Global Business Solutions India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[hashmap internal implementation analysis in java]]></category>
		<category><![CDATA[hashmap internal working]]></category>
		<category><![CDATA[hashmap iterator implementation]]></category>
		<category><![CDATA[hashmap java]]></category>
		<category><![CDATA[hashset vs hashmap]]></category>
		<category><![CDATA[how hashmap works internally]]></category>
		<category><![CDATA[how hashmap works internally in java]]></category>
		<category><![CDATA[how hashmap works internally in java with example]]></category>
		<category><![CDATA[how hashtable works internally in java]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[implement hashmap in java interview]]></category>
		<category><![CDATA[implement hashmap without using collections]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[L&T Infotech interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[NetApp interview questions and answers]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Persistent Systems interview questions and answers]]></category>
		<category><![CDATA[RBS India De interview questions and answers]]></category>
		<category><![CDATA[Reliance Industries Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[Virtusa Consulting Services Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Wells Fargo interview questions and answers]]></category>
		<category><![CDATA[what is hashmap]]></category>
		<category><![CDATA[Wipro Infotech interview questions and answers]]></category>
		<category><![CDATA[write your own hashmap/hashtable implementation in java]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=629</guid>

					<description><![CDATA[Answer : HashMap is one of the most widly used implementation of Map to store key-value pairs...]]></description>
										<content:encoded><![CDATA[<div class="TextHeading">
<div class="hddn">
<h2 id="how-hashmap-works-in-java" class="color-pink" style="text-align: justify;">How HashMap Works in Java ?</h2>
<p><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-4229" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map.png" alt="" width="1361" height="992" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map.png 1361w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-300x219.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-1024x746.png 1024w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-768x560.png 768w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-390x284.png 390w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-820x598.png 820w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-1180x860.png 1180w" sizes="(max-width: 1361px) 100vw, 1361px" /></p>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>HashMap is one of the most widly used implementation of Map to store key-value pairs. To implement HashMap with ArrayList.</li>
<li>It is provides two basic HashMap functions they are: get(key) and put(key, value).</li>
<li>While storing code to be checking the duplicate values. While duplicate values are presents to be removed.</li>
<li>Implementation should not be used as a replacement of HashMap. Also while testing the code, make sure that the Object used in the KEY has proper implementation of equals() method.</li>
</ul>
</div>
</div>
<div class="text-center row" style="text-align: justify;"><img decoding="async" class="alignnone size-full wp-image-4230" src="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-works.png" alt="" width="754" height="650" srcset="https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-works.png 754w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-works-300x259.png 300w, https://www.wikitechy.com/interview-questions/wp-content/uploads/2021/07/hash-map-works-390x336.png 390w" sizes="(max-width: 754px) 100vw, 754px" /></div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="example" class="color-blue">Example:</h2>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight"><div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-java code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-java code-embed-code">package com.journaldev.util;<br/><br/>import java.util.ArrayList;<br/>import java.util.List;<br/><br/>public class MyHashMap {<br/><br/>	class Container{<br/>		Object key;<br/>		Object value;<br/>		public void insert(Object k, Object v){<br/>			this.key=k;<br/>			this.value=v;<br/>		}<br/>	}<br/>	<br/>	private Container c;<br/>	private List&lt;Container&gt; recordList;<br/>	<br/>	public MyHashMap(){<br/>		<br/>		this.recordList=new ArrayList&lt;Container&gt;();<br/>	}<br/>	<br/>	public void put(Object k, Object v){<br/>		this.c=new Container();<br/>		c.insert(k, v);<br/>		//check for the same key before adding<br/>		for(int i=0; i&lt;recordList.size(); i++){<br/>			Container c1=recordList.get(i);<br/>			if(c1.key.equals(k)){<br/>				//remove the existing object<br/>				recordList.remove(i);<br/>				break;<br/>			}<br/>		}<br/>		recordList.add(c);<br/>	}<br/>	<br/>	public Object get(Object k){<br/>		for(int i=0; i&lt;this.recordList.size(); i++){<br/>			Container con = recordList.get(i);<br/>			//System.out.println(&quot;k.toString():&quot;+k.toString()+&quot;con.key.toString()&quot;+con.key.toString());<br/>			if (k.toString()==con.key.toString()) {<br/>				<br/>				return con.value;<br/>			}<br/>			<br/>		}<br/>		return null;<br/>	}<br/>	<br/>	public static void main(String[] args) {<br/>		MyHashMap hm = new MyHashMap();<br/>		hm.put(&quot;1&quot;, &quot;1&quot;);<br/>		hm.put(&quot;2&quot;, &quot;2&quot;);<br/>		hm.put(&quot;3&quot;, &quot;3&quot;);<br/>		System.out.println(hm.get(&quot;3&quot;));<br/>		hm.put(&quot;3&quot;, &quot;4&quot;);<br/>		<br/>		System.out.println(hm.get(&quot;1&quot;));<br/>		System.out.println(hm.get(&quot;3&quot;));<br/>		System.out.println(hm.get(&quot;8&quot;));<br/>	}<br/><br/>}</code></pre> </div></figure>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="output" class="color-blue">Output:</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn"></div>
</div>
<div class="Output">
<div class="hddn">
<figure class="highlight" style="text-align: justify;">
<pre><code class="hljs javascript" data-lang=""><span class="nt"><span class="hljs-number">3</span>
<span class="hljs-number">1</span>
<span class="hljs-number">4</span>
<span class="hljs-literal">null</span></span></code></pre>
</figure>
</div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/java/how-hashmap-works-in-java/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
