blob: 591192c9fc8602faec7f434bb34437b9fe97b417 [file] [log] [blame]
Clément Bérab1253f02021-02-03 10:21:33 +00001// Copyright (c) 2020, the R8 project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5package records;
6
7public class RecordInstanceOf {
8
9 record Empty() {}
10
11 record Person(String name, int age) {}
12
13 public static void main(String[] args) {
14 Empty empty = new Empty();
15 Person janeDoe = new Person("Jane Doe", 42);
16 Object o = new Object();
17 System.out.println(janeDoe instanceof java.lang.Record);
18 System.out.println(empty instanceof java.lang.Record);
19 System.out.println(o instanceof java.lang.Record);
20 }
21}