Created
January 17, 2020 11:55
-
-
Save jon-ruckwood/34f22c68d2aa3d9e222f80d031cc9567 to your computer and use it in GitHub Desktop.
Java 14 record example, compile and run with `--enable-preview`
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RecordExample { | |
public static void main(String[] args) { | |
Interval i = new Interval(1, 2); | |
System.out.println("interval: " + i); | |
} | |
record Interval(int begin, int end) { | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment