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
Can vector have duplicates in java?
what invokes a threads run() method? : Java thread
What is an array length?
Why object class is super class for every class in java?
What is the main purpose of java?
What do you mean by Hash Map and Hash Table?
What are parameters in a method?
What are user defined exceptions?
we have syntax like for(int var : arrayName) this syntax is to find whether a number is in the array or not.but i want to know how to find that number's location.
What is return code?
What do you mean by formatting?
What is the syntax and characteristics of a lambda expression? Explain
What is set and get methods in java?
Which one of the following suits the description of a string better: derived or primitive?
What is qualitative variable?