JavaPatternMatching/resources/bytecode/javFiles/InstanceOf.jav

18 lines
373 B
Plaintext
Raw Normal View History

2024-01-31 16:27:18 +00:00
import java.lang.Object;
2023-08-18 09:35:01 +00:00
import java.lang.Integer;
2024-01-31 16:27:18 +00:00
import java.lang.Boolean;
interface Interface {}
class Test implements Interface {
}
class Test2 {
}
2023-08-18 09:35:01 +00:00
public class InstanceOf {
2024-01-31 16:27:18 +00:00
a = new Test();
2023-08-18 09:35:01 +00:00
2024-03-14 12:50:56 +00:00
public test1() { return this.a instanceof Test; }
public test2() { return this.a instanceof Interface; }
public test3() { return this.a instanceof Integer; }
2023-08-18 09:35:01 +00:00
}