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
What is the association?
Is integer immutable in java?
Can long be null in java?
What is append function?
how to deploy tomcatserver to weblogic server? write d following steps?
How to split arraylist elements in java?
What is difference between iterator access and index access?
What is a qualifier in a sentence?
How to print an arraylist in java?
Do I need to import java.lang package any time? Why?
What is array and arraylist in java?
What is primitive data type in java?
What is hashset in java?
What are inner classes or non static nested classes in java?
How many types of threads are there in java?