mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-22 14:50:53 +07:00
16 lines
286 B
Java
16 lines
286 B
Java
|
|
class Main {
|
|
void f(Object o) {
|
|
if (o instanceof CharSequence cs && cs instanceof String s) {
|
|
System.out.println(s);
|
|
}
|
|
}
|
|
|
|
void g(Object o) {
|
|
switch (o) {
|
|
case Integer i when o instanceof String s:
|
|
System.out.println(s);
|
|
default:
|
|
};
|
|
}
|
|
} |