blob: 35a3632ec302f712d354e2890e35ce661a1ab6eb [file] [log] [blame]
Søren Gjesse96b37252021-08-09 16:08:05 +02001// Copyright (c) 2021, 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 pattern_matching_for_instanceof;
6
7final class Main {
8 public static void main(String[] args) {
9 Object obj = "Hello, world!";
10 if (obj instanceof String s) {
11 System.out.println(s);
12 }
13 }
14}