Class StatementsBeforeSuperPreviewNotes
java.lang.Object
net.jrodolfo.java_evolution.java22.statements_before_super.StatementsBeforeSuperPreviewNotes
Explains statements before
super(...) as a Java 22 preview feature.
Before this feature, an explicit super(...) or this(...) call
had to be the first constructor statement. That made argument validation or
preparation awkward when the superclass constructor needed already-checked
values.
Java 22 previewed a more flexible constructor body while preserving the
important safety rule: code before super(...) still cannot use the
instance being constructed.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionExplains how the feature name evolved after the first preview.nextStep()Points learners to the final Java 25 example.oldRule()Explains the old constructor rule.Explains the practical problem.Explains why this package uses notes.Names the key safety limitation.
-
Constructor Details
-
StatementsBeforeSuperPreviewNotes
public StatementsBeforeSuperPreviewNotes()
-
-
Method Details
-
oldRule
-
problemSolved
-
safetyRule
-
namingEvolution
Explains how the feature name evolved after the first preview.- Returns:
- a short naming-history note
-
nextStep
Points learners to the final Java 25 example.- Returns:
- a short next-step note
-
projectDecision
-