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 default value of the local variables?
What are adapter classes?
Is constructor inherited?
Discuss 2D arrays.
How to create a fecelet view?
What is difference between pointer and reference?
List out benefits of object oriented programming language?
Explain the difference between a Thread and a Process.
Is java a compiler?
Is null a value?
How many return statement are allowed in a function?
What is boolean flag in java?
What is variable explain?
What is abstraction in java?
What is the use of math abs in java?