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
explain local datetime api in java8?
What is time complexity java?
What are features of java?
How do we access static members in java?
What are the four corner stones of oop?
What are the advantages of user defined functions?
What is the purpose of the runtime class in java programming?
What is indexof in java?
How can you handle java exceptions?
How do you create a method in java?
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
What is a stack class in java ?
What is a lock or purpose of locks in java?
Difference between process and thread?
Can final class have constructor?