1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import java.util.*;
public class HashTableDemo
{ public static void main(String[] args)
{
Hashtable numbers = new Hashtable();
numbers.put( "one" , new Integer( 1 ));
numbers.put( "two" , new Integer( 2 ));
numbers.put( "three" , new Integer( 3 ));
Integer n = (Integer)numbers.get( "two" );
if (n != null )
{
System.out.println( "two = " +n);
}
}
} |
运行结果:
two = 2
版权声明:原创作品,如需转载,请注明出处。否则将追究法律责任
本文转自 liam2199 博客,原文链接: http://blog.51cto.com/liam2199/1959269 如需转载请自行联系原作者
本文转自 liam2199 博客,原文链接: http://blog.51cto.com/liam2199/1959269 如需转载请自行联系原作者