jpython HashMap 的使用

'''
Created on 2011-5-3

@author: Japie
'''
import os
import sys
from java.util.Iterator import *
from java.util.Set.iterator import *
from java.util import *
clustHM = HashMap()
clustHM.put( 'a', '1' );
clustHM.put( 'b', '2' );
clustHM.put( 'c', '3' );
clustHM.put( 'd', '4' );
print 'this is a test'
iter = clustHM.keySet().iterator()
for key in iter:
    print key
    print  clustHM.get( key )


for mapkey in clustHM:
    print 'map value:' + clustHM.get( mapkey )
   
this is a test
d
4
b
2
c
3
a
1
map value:4
map value:2
map value:3
map value:1

你可能感兴趣的:(java,C++,c,OS,C#)