Skip to content

Instantly share code, notes, and snippets.

@sebastienblanc
Created September 1, 2020 15:31
Show Gist options
  • Save sebastienblanc/0e1cf856dc7c964af7a3b866e0395976 to your computer and use it in GitHub Desktop.
Save sebastienblanc/0e1cf856dc7c964af7a3b866e0395976 to your computer and use it in GitHub Desktop.
Showing Java Record
//usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 14
//JAVAC_OPTIONS --enable-preview -source 14
//JAVA_OPTIONS --enable-preview
public record Pet(String name, int age) {}
var pet = new Pet("Nuage",6);
System.out.println(pet);
/exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment