blob: f5a828a2366f4eb25aa4544d07931e863b6df9f9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
class IsInstanceTest extends Thread implements Cloneable
{
static void main(String args[])
{
IsInstanceTest test = new IsInstanceTest();
if (test instanceof java.lang.Object)
pass("IsInstanceTest is instance of java.lang.Object");
else
fail("IsInstanceTest is not instance of java.lang.Object");
if (test instanceof java.lang.Cloneable)
pass("IsInstanceTest is instance of java.lang.Cloneable");
else
fail("IsInstanceTest is not instance of java.lang.Cloneable");
if (test instanceof java.lang.Runnable)
pass("IsInstanceTest is instance of java.lang.Runnable");
else
fail("IsInstanceTest is not instance of java.lang.Runnable");
}
static void pass(String message)
{
System.out.println("PASSED: "+message);
}
static void fail(String message)
{
System.out.println("FAILED: "+message);
}
}
|