hello everyone i hope someone can help i have the code below which tests if any strings are the same to print them out plus there key values but now i want to able to delete the values and the key names that have already been used can anyone help please thanks loftty import java.io.*; import java.util.*; import java.lang.*;
public class Has { public static void main(String[] args) {
ArrayList arr = new ArrayList(); Hashtable hash = new Hashtable(); String st; //column names String s; String p; String t; String st1 = new String("ben"); String st2 = new String("alex"); //table names String st3 = new String("ben"); String st4 = new String("ben"); hash.put(st = "hello", st1); hash.put(t = "hehe", st2); hash.put(s = "id", st3); hash.put(p = "great", st4);
Enumeration e = hash.keys(); while (e.hasMoreElements()) { String key = (String)e.nextElement(); String se = (String) hash.get(key);
if (se.equals(st1)){ System.out.println(se+"\n"+key); } if (se.equals(st2)){ System.out.println(se+"\n"+key); }