Re: Class Struktur
Stefan Meyer wrote:
hello, i [sic] want to add a calss to a hass
Watch your spelling.
...
public class JConfig {
public static HashMap<String, HashMap> data = new
LinkedHashMap<String, HashMap>();
...
try {
while (db.rs.next()) {
JConfigEntry c = new JConfigEntry();
c.setCID(db.rs.getInt("CID"));
c.setCkey(db.rs.getString("ckey"));
c.setCvalue(db.rs.getString("cvalue"))=
;
c.setCdescription(db.rs.getString("cde=
scription"));
data.put("sys", c);
}
} catch (SQLException e) {
System.out.println("SQL Exception: " + e.toStr=
ing());
}
...
i [sic] get alwys this error: cannot find symbol at this line
Copy and paste error messages for Usenet posts; don't paraphrase.
data.put("sys", c);
Whats wrong ?
Many things are wrong, but in particular for the error about which you
ask, 'data' is defined as a
'HashMap<String, HashMap> ' (which lacks complete generic
typification), but you are calling put with a
'( String, JConfigEntry )' argument pair. There is not a definition
for the symbol 'put( String, JConfigEntry )' so the compiler complains
that it cannot find that symbol.
--
Lew