提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
检查哈希表中是否存在特定值
// 来自 N o w J a v a . c o m import java.util.Hashtable; public class Main { public static void main(String[] args) { Hashtable ht = new Hashtable(); ht.put("1","One"); ht.put("2","Two"); ht.put("3","Three"); boolean blnExists = ht.contains("Two"); System.out.println("Two exists in Hashtable ? : " + blnExists);/*时 代 J a v a - N o w J a v a . c o m 提供*/ } }