Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

write a progam hashmap & hashtable?

Answer Posted / dileep

import java.io.*;
class Hashtable
{
public static void main (String args[])
{
Hashtable h=new hahtable();
h.add("dil");
h.add("ppp");
h.add("kkk");
System.out.println("the value of h is "+h);
System.out.println("the value of size is"+h.size());
}
}
import java.io.*;
class Hashmap
{
public static void main(String args[])
{
h.put("1","kkk");
h.put("2","ppp");
System.out.println("the value of h is"+h);
}
}
suppose if we use the haahtable then the we have to use
Enumeration concept and suppose if we use the HashMap then
we have to use Iterator concept.

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java argument list?

889


Is null a string?

948


What does int argc char * argv [] mean?

943


What is anagram number?

892


what are synchronized methods and synchronized statements? : Java thread

954


What do you mean by local class?

962


What is final keyword in java?

979


What are the two ways of implementing multi-threading in java?

1435


What are different access specifiers in java? Explain

1067


What is the difference between the direct buffer and non-direct buffer in java?

988


What is the purpose of finalization in java programming?

994


What is flag in java?

932


Difference between concurrent hashmap and hashtable and collections

1011


What is difference between ++ I and I ++ in java?

921


Can a class declared as private be accessed outside it’s package?

958