Page 1 of 1

Geben Sie Sicherheit ein: Deaktivierte Besetzung vom Objekt

Posted: 22 Aug 2025, 02:35
by Anonymous
Ich versuche, ein Objekt in meine Aktionsklasse zu geben, aber es führt zu einer Warnung: < /p>

Type safety: Unchecked cast from Object to Action

Action action = null;
try {
Object o = c.newInstance();
if (o instanceof Action) {
action = (Action) o;
} else {
// TODO 2 Auto-generated catch block
throw new InstantiationException();
}
[...]
< /code>

Vielen Dank für jede Hilfe < /p>