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 java argument list?
Is null a string?
What does int argc char * argv [] mean?
What is anagram number?
what are synchronized methods and synchronized statements? : Java thread
What do you mean by local class?
What is final keyword in java?
What are the two ways of implementing multi-threading in java?
What are different access specifiers in java? Explain
What is the difference between the direct buffer and non-direct buffer in java?
What is the purpose of finalization in java programming?
What is flag in java?
Difference between concurrent hashmap and hashtable and collections
What is difference between ++ I and I ++ in java?
Can a class declared as private be accessed outside it’s package?