Created
January 22, 2022 16:02
-
-
Save TGITS/bad2a960a3f13916b42274fe6cf5be78 to your computer and use it in GitHub Desktop.
Un exemple de record avec des types paramétrés et une méthode statique
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 record Pair<U,V>(U first, V second) { | |
public static <U,V>Pair<U,V> of(U first, V second) { | |
return new Pair<>(first,second); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment