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
How do you empty a list in java?
What is parse method?
What are the drawbacks of reflection?
Why deletion in linkedlist is fast than arraylist?
What is a method vs function?
What is unicode full form?
Can we clone singleton object?
What are thread priorities and importance of thread priorities in java?
Describe what a thread-local variable is in java?
What is a databasemetadata?
What is jagged array in java?
What is the default size of load factor in hashing based collection?
What is the implementation of destroy method in java. Is it native or java code?
How does java enable high performance?
What is array sorting in java?