Hallo
ich habe ein Problem mit Eclipse (3.0), und zwar habe ich bei javabuch.de das Buch runtergeladen bin jetzt bei Kapitel „14.4 Die Klasse Hashtable“ da ist dann folgender Code angegeben, den ich bei Eclipse eingetippt hab:
001 /\* Listing1403.java \*/
002
003 import java.util.\*;
004
005 public class Listing1403
006 {
007 public static void main(String[] args)
008 {
009 Hashtable h = new Hashtable();
010
011 //Pflege der Aliase
012 h.put("Fritz","[email protected]");
013 h.put("Franz","[email protected]");
014 h.put("Paula","[email protected]");
015 h.put("Lissa","[email protected]");
016
017 //Ausgabe
018 Enumeration e = h.keys();
019 while (e.hasMoreElements()) {
020 String alias = (String)e.nextElement();
021 System.out.println(
022 alias + " --\> " + h.get(alias)
023 );
024 }
025 }
026 }
Doch Eclipse erkennt da einen Fehler:
„The method put(String, String) is undefined for the type Hashtable“,
„The method keys() is undefined for the type Hashtable“,
„The method get(String) is undefined for the type Hashtable“
Ist das Buch etwa schon etwas veraltet und es gibt die Methode „put“ nicht mehr oder liegt es an der Konfiguration von Eclipse!?