Skip to content

Instantly share code, notes, and snippets.

@jon-ruckwood
Created January 17, 2020 11:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jon-ruckwood/34f22c68d2aa3d9e222f80d031cc9567 to your computer and use it in GitHub Desktop.
Save jon-ruckwood/34f22c68d2aa3d9e222f80d031cc9567 to your computer and use it in GitHub Desktop.
Java 14 record example, compile and run with `--enable-preview`
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