2024-01-31 17:27:18 +01:00
|
|
|
import java.lang.Object;
|
2023-08-18 11:35:01 +02:00
|
|
|
import java.lang.Integer;
|
2024-01-31 17:27:18 +01:00
|
|
|
import java.lang.Boolean;
|
|
|
|
|
|
|
|
interface Interface {}
|
|
|
|
|
|
|
|
class Test implements Interface {
|
|
|
|
}
|
|
|
|
class Test2 {
|
|
|
|
}
|
2023-08-18 11:35:01 +02:00
|
|
|
|
|
|
|
public class InstanceOf {
|
2024-01-31 17:27:18 +01:00
|
|
|
a = new Test();
|
2023-08-18 11:35:01 +02:00
|
|
|
|
2024-03-14 13:50:56 +01: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 11:35:01 +02:00
|
|
|
}
|