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
Are generics important java?
define the terminology association.
What is meant by main method?
What is a variable declaration?
what are three ways in which a thread can enter the waiting state? : Java thread
Can an interface be defined inside a class?
how to open and edit XML file in Weblogic???
What is the different types of functions?
Which is faster call by value or call by reference?
How does list work in java?
Differentiate between the constructors and methods in java?
Can we use string in switch case in java?
How to sort an array in java without using sort method?
Why synchronization is important?
Why is java so important?