staticclass Inner1 { staticint x = 1; // OK - class is top-level staticfinalint y = x * 5; // OK - class is top-level staticfinal String z; // OK - class is top-level static {
z = "foobar";
}
}
class Inner2 { staticint x = 1; // ERROR - static not final staticfinal String z; // ERROR - static blank final
{
z = "foobar"; // Error may be reported here. See 4278961.
}
}
// This case must go in a separate class, as otherwise the detection // of the error is suppressed as a result of recovery from the other // errors.
class Inner3 { staticfinalint y = Inner1.x * 5; // ERROR - initializer not constant
}
}
¤ Dauer der Verarbeitung: 0.11 Sekunden
(vorverarbeitet)
¤
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 ist noch experimentell.