<human>: Convert the following Java 8 pattern matching to Java 17 using instanceof:

```java
// Java 8 code
Object obj = "Hello";
if (obj instanceof String) {
  String str = (String) obj;
  System.out.println(str);
}
```

<bot>: ```java
// Java 17 pattern matching for instanceof
Object obj = "Hello";
if (obj instanceof String str) {
  System.out.println(str);
}
```