File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes HashMap Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "HashMap" Watch "HashMap" New topic


raghuram bikkani

Joined: Jan 18, 2006
Posts: 16
How can u implement HashMap if u don't have a HashMap?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

HashMap is not an interface, so you cannot implement it. Do you mean java.util.Map?

[Asking smart questions] [About Bear] [Books by Bear]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
I don't understand your question. HashMap is a concrete class, so you can create objects from it:

Does this help?


Java API Documentation
The Java Tutorial
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

I guess that he wants to mimic the behavious of HashMap.
By 'implement' he means 'create'.

[My Blog]
All roads lead to JavaRanch
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15084

Originally posted by raghuram bikkani:
How can u implement HashMap if u don't have a HashMap?

What do you mean? If you have a REALLY OLD version of Java that doesn't have HashMap, you can use java.util.Hashtable.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: HashMap
It's not a secret anymore!