Skip to content

Commit

Permalink
Update valhalla example
Browse files Browse the repository at this point in the history
  • Loading branch information
marchof committed May 9, 2024
1 parent 87e2c3a commit ab9b620
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions site/content/jdk/valhalla/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,24 @@ Online sandbox for the latest early access build of [Valhalla project](https://j
{{< sandbox version="javavalhalla" mainclass="Valhalla" preview="true" >}}
{{< sandboxsource "Valhalla.java" >}}
value class X {
}

identity record Id(String key) {
final int i;

X(int i) {
this.i = i;
}

}

public class Valhalla {

public static void main(String[] args) {
System.out.println(new X());
System.out.println(new Id("me"));
var x1 = new X(5);
var x2 = new X(5);
var x3 = new X(7);

System.out.println(x1 == x2);
System.out.println(x1 == x3);
}

}
Expand Down

0 comments on commit ab9b620

Please sign in to comment.