44 lines
715 B
Plaintext
44 lines
715 B
Plaintext
|
class Instanceof {
|
||
|
|
||
|
Instanceof(){
|
||
|
super(());
|
||
|
}
|
||
|
void checkInstanceof(){
|
||
|
TPH a;
|
||
|
a = 4;
|
||
|
return a instanceof java.lang.Integer;
|
||
|
}
|
||
|
|
||
|
void checkInstanceOfWithPattern(){
|
||
|
TPH b;
|
||
|
b = 4.0;
|
||
|
if(b instanceof d)
|
||
|
{
|
||
|
return d;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
return Kein Double;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
void checkInstanceOfWithGuardedPattern(){
|
||
|
TPH obj;
|
||
|
obj = test;
|
||
|
TPH flag;
|
||
|
if(obj instanceof s op s.length Signature: [TPH]() op 5)
|
||
|
{
|
||
|
flag = s.contains Signature: [TPH, TPH](jdk);
|
||
|
};
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
java.lang.Boolean equals(java.lang.Object o){
|
||
|
return o instanceof other op x op other.x op y op other.y;
|
||
|
}
|
||
|
|
||
|
Instanceof(){
|
||
|
super(());
|
||
|
}
|
||
|
|
||
|
}
|