Difference between revisions of "Use a Hash Table"

From Progzoo
Jump to navigation Jump to search
(New page: <table style="border-style:solid;float:right"><caption>pop</caption> <tr><th>key</th><th>value</th></tr> <tr><td>France</td><td align="right">60000000</td></tr> <tr><td>China</td><td align...)
 
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{topTenTips}}
 +
<question lang="java" className="Demo">
 
<table style="border-style:solid;float:right"><caption>pop</caption>
 
<table style="border-style:solid;float:right"><caption>pop</caption>
 
<tr><th>key</th><th>value</th></tr>
 
<tr><th>key</th><th>value</th></tr>
Line 8: Line 10:
 
each country.
 
each country.
 
</p>
 
</p>
==Create and Use a Hash Table==
+
<prog>
<question xmlns:htm="http://www.w3.org/1999/xhtml" lang="java" className="Demo"><prog>
 
 
import java.util.HashMap;
 
import java.util.HashMap;
 
public class Demo{
 
public class Demo{
Line 21: Line 22:
 
}
 
}
 
</prog>
 
</prog>
<p>
 
</p>
 
 
</question>
 
</question>
 +
For more on [[Hash Maps]]

Latest revision as of 17:31, 19 October 2011

pop
keyvalue
France60000000
China1300000000

You can use a hash table to record a number against the name of each country.


[Font] [Default] [Show] [Resize] [History] [Profile]

For more on Hash Maps