aboutsummaryrefslogtreecommitdiffstats
path: root/tests/features1919/java19/RecordPatternsPreview1ExhaustivenessOK2.java
blob: 8f80aad903e6f7e5a2646fdc25ca8a31974be3a9 (plain)
1
2
3
4
5
6
7
8
9
10
public class RecordPatternsPreview1ExhaustivenessOK2 {
  public static void main(String[] args) {
    Person person = new Person("Bob", 12);
    switch (person) {
      case Person(var name, var age) -> System.out.println(name + " " + age);
    }
  }
}

record Person(String name, int age) { }