source: trunk/gcc/libjava/testsuite/libjava.jni/throwit.java

Last change on this file was 2, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 593 bytes
Line 
1// Test to see if throw works.
2
3public class throwit
4{
5 static
6 {
7 System.loadLibrary ("throwit");
8 }
9
10 public static native void throwit (String name, boolean is_new);
11
12 public static void main (String[] args)
13 {
14 try
15 {
16 throwit ("java/lang/UnknownError", false);
17 }
18 catch (Throwable x)
19 {
20 System.out.println (x.getClass ());
21 System.out.println (x.getMessage ());
22 }
23 try
24 {
25 throwit ("java/lang/Throwable", true);
26 }
27 catch (Throwable x)
28 {
29 System.out.println (x.getClass ());
30 System.out.println (x.getMessage ());
31 }
32 }
33}
Note: See TracBrowser for help on using the repository browser.