Skip to content

Commit

Permalink
Update JDK 22 examples
Browse files Browse the repository at this point in the history
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
  • Loading branch information
manoelcampos committed Apr 26, 2024
1 parent 1d020c3 commit 946f670
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/Jdk22SubClass.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/**
* A sample class that doesn't belong to any package,
* that uses {@link Jdk22SuperClass}, and enables you to compile
Expand Down
5 changes: 4 additions & 1 deletion src/main/java/samples/jdk22/Jdk22.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public class Jdk22 extends SampleClass {
* Instance main method. A simplified version of the main method that can be used in a class,
* which doesn't require to be static and don't need a String array if you aren't going
* to take command line parameters.
* Started as preview in JDK 11. Second preview in JDK 22.
* @see <a href="https://openjdk.org/jeps/445"></a>
* @see <a href="https://openjdk.org/jeps/463"></a>
*/
void main() {
Expand All @@ -39,10 +41,11 @@ void main() {
*/
public Jdk22(){
// Calling any statements before a super or this construtor was not allowed before.
String jdkVersion = "JDK 22";
unamedVar();
stringTemplate();
jsonStringTemplate();
super("JDK 22");
super(jdkVersion);
}

/**
Expand Down

0 comments on commit 946f670

Please sign in to comment.