We are working on hashtables and i am trying to figure out


We are working on hashtables and I am trying to figure out a real life example that could be solved with hashtables to jtree as well as some type of array or jlist. I just need some opinions or examples of this part please.

Here is an exercise I do not understand in this chapter.

Observe the following code, which creates a simple hashtable.
// Demonstrate a Hashtable
import java.util.*;
class HTDemo
{
public static void main(String args[])
{
Hashtable numbers = new
Hashtable();

numbers.put("one", new Integer(1));
numbers.put("two", new Integer(2));

}
}

Starting with this provided code, add the following functionality:

1. Add the numbers 3 through 10 to the hashtable continuing in the same manner as shown.

2. Prompt the user for a string, and display the corresponding number. For example, if the user types "five", the program would output "5". This must be done using the hashtable as created in the previous step.

3. Using a loop and a single printlng statement, display all of the values (both strings and integers) in a table.

Solution Preview :

Prepared by a verified Expert
Software Engineering: We are working on hashtables and i am trying to figure out
Reference No:- TGS01257696

Now Priced at $20 (50% Discount)

Recommended (94%)

Rated (4.6/5)