Geben Sie Sicherheit ein: Deaktivierte Besetzung vom Objekt

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Geben Sie Sicherheit ein: Deaktivierte Besetzung vom Objekt

by Anonymous » 22 Aug 2025, 02:35

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>

Top