Skip to content

Latest commit

 

History

History
36 lines (25 loc) · 817 Bytes

README.md

File metadata and controls

36 lines (25 loc) · 817 Bytes

hashtable

import java.util.Enumeration; import java.util.Hashtable;

public class HashtableTest {

public static void main(String[] args) {
	Hashtable h = new Hashtable();
	
	h.put("Willi Frankien", "[email protected]");
	h.put("Hugo Meier", "[email protected]");
	h.put("Sabine Moll", "[email protected]");
	
	System.out.println("NAME -> ADRESSE");
	
	Enumeration keys = h.keys();
	
	while (keys.hasMoreElements()){
		String key = (String) keys.nextElement();
		String value = (String) h.get(key);
		System.out.println(key + " -> " + value);
	}

	System.out.println();
	
	System.out.println("Email- Adressen: ");
	Enumeration elements = h.elements();
	
	while (elements.hasMoreElements()){
		String value = (String) elements.nextElement();
		System.out.println(value);
	}
}

}