Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
GavinBierman
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
3 ms
·
1.
▲
by
GavinBierman
4y ago
This is all true, but with pattern matching for instanceof you don't need the explicit cast: Object foo = ... if (foo instanceof String s) { System.out.println(s.toLowerCase()) } In this case, the scope of the