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 many bits is a string?
How do I know if java is installed?
Can string be considered as a keyword?
What is the program development process?
Which collection is ordered in java?
What are different types of expressions?
Can a final variable be manipulated in java?
What is java in detail?
Why does java not support operator overloading?
What is skeleton and stub? What is the purpose of those?
What are the legal operands of the instanceof operator?
What is memory leak and how does java handle it?
What is the scope or life time of instance variables?
Why collection is called framework in java?
Can we use both this () and super () in a constructor?