publicclass PutAndPutAll { publicstaticvoid main(String[] args) throws Exception {
Attributes at = new Attributes(); try{
at.put("this is not an Attributes.Name", "value"); thrownew Exception("put should check for non Attributes.Name names");
} catch (ClassCastException e) {
}
try{
at.put(new Attributes.Name("name"), new Integer(0)); thrownew Exception("put should check for non String values");
} catch (ClassCastException e) {
}
try {
at.putAll(new HashMap()); thrownew Exception("putAll should check for non Attributes maps");
} catch (ClassCastException e) {
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.