mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-25 00:25:50 +08:00
instance.out: New file.
* libjava.lang/instance.out: New file. * libjava.lang/instance.java: New file. From-SVN: r33941
This commit is contained in:
parent
66e85f3856
commit
3faf9b6b1f
@ -1,3 +1,8 @@
|
||||
2000-05-16 Tom Tromey <tromey@cygnus.com>
|
||||
|
||||
* libjava.lang/instance.out: New file.
|
||||
* libjava.lang/instance.java: New file.
|
||||
|
||||
2000-05-10 Bryce McKinlay <bryce@albatross.co.nz>
|
||||
|
||||
* libjava.lang/StringBuffer_1.java: New file.
|
||||
|
48
libjava/testsuite/libjava.lang/instance.java
Normal file
48
libjava/testsuite/libjava.lang/instance.java
Normal file
@ -0,0 +1,48 @@
|
||||
// instance.java -- test the `instanceof' operator.
|
||||
|
||||
import java.util.EventListener;
|
||||
|
||||
public class instance implements EventListener
|
||||
{
|
||||
public static void main (String[] args)
|
||||
{
|
||||
Object x1 = new instance ();
|
||||
EventListener x2 = new instance ();
|
||||
IllegalArgumentException iae
|
||||
= new IllegalArgumentException ("any random class");
|
||||
String x3 = "zardoz";
|
||||
Object x4 = "zardoz";
|
||||
|
||||
// Test simple object stuff
|
||||
System.out.println (x1 instanceof Object);
|
||||
System.out.println (x1 instanceof IllegalArgumentException);
|
||||
System.out.println (x1 instanceof EventListener);
|
||||
System.out.println (x1 instanceof String);
|
||||
System.out.println ("=");
|
||||
|
||||
// Test with value which is an interface.
|
||||
System.out.println (x2 instanceof Object);
|
||||
System.out.println (x2 instanceof IllegalArgumentException);
|
||||
System.out.println (x2 instanceof EventListener);
|
||||
System.out.println ("=");
|
||||
|
||||
// Test with value which is a final class.
|
||||
System.out.println (x3 instanceof Object);
|
||||
System.out.println (x3 instanceof String);
|
||||
System.out.println ("=");
|
||||
|
||||
// Test with value which is a random class.
|
||||
System.out.println (iae instanceof Object);
|
||||
System.out.println (iae instanceof IllegalArgumentException);
|
||||
System.out.println (iae instanceof EventListener);
|
||||
System.out.println ("=");
|
||||
|
||||
// Test with value which is a final class, but not known
|
||||
// statically.
|
||||
System.out.println (x4 instanceof Object);
|
||||
System.out.println (x4 instanceof IllegalArgumentException);
|
||||
System.out.println (x4 instanceof EventListener);
|
||||
System.out.println (x4 instanceof String);
|
||||
System.out.println (x4 instanceof int[]);
|
||||
}
|
||||
}
|
21
libjava/testsuite/libjava.lang/instance.out
Normal file
21
libjava/testsuite/libjava.lang/instance.out
Normal file
@ -0,0 +1,21 @@
|
||||
true
|
||||
false
|
||||
true
|
||||
false
|
||||
=
|
||||
true
|
||||
false
|
||||
true
|
||||
=
|
||||
true
|
||||
true
|
||||
=
|
||||
true
|
||||
true
|
||||
false
|
||||
=
|
||||
true
|
||||
false
|
||||
false
|
||||
true
|
||||
false
|
Loading…
Reference in New Issue
Block a user